Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON parse errors should report the offending text #387

Open
starpit opened this issue Feb 10, 2025 · 0 comments
Open

JSON parse errors should report the offending text #387

starpit opened this issue Feb 10, 2025 · 0 comments
Labels
bug Something isn't working interpreter

Comments

@starpit
Copy link
Member

starpit commented Feb 10, 2025

Describe the bug

pdl /tmp/foo.pdl

user: 3Attempted to parse ill-formed JSON: TypeError('the JSON object must be str, bytes or bytearray, not int')

To Reproduce

code: |
  result = 3
parser: json
lang: python

Expected behavior
Obviously in this simple example, the error message might be fine. Though it is strange to report JSON parse errors in terms of Python data types?

In a complex program with dynamic data, I think it becomes important to report the offending text that could not be parsed as JSON.

Screenshots
n/a

Desktop (please complete the following information):

  • OS: macOS
  • Browser n/a
  • Version PDL 0.2.1.dev88+g334a253.d20250131

Additional context
n/a

@starpit starpit added the bug Something isn't working label Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working interpreter
Projects
None yet
Development

No branches or pull requests

2 participants