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

Feature request: Improved JSON debugging #67

Open
robinsmidsrod opened this issue Oct 1, 2023 · 0 comments
Open

Feature request: Improved JSON debugging #67

robinsmidsrod opened this issue Oct 1, 2023 · 0 comments

Comments

@robinsmidsrod
Copy link

Whenever I send an invalid command to the CP I'm getting this information in the log:

10/1/2023, 1:44:08 PM    node: OCPP Server Port 9595     type: ERROR     data: Unexpected token
 in JSON at position 96

First of all, the token part (when looked in a hex editor) is the symbol ^@, which I'm not sure what represents.

When I try to determine which part of of the message is wrong, by copying the message I think is the problem into a text editor and find the position mentioned, it is commonly outside the end of the string. It makes it quite non-trivial to use this message for anything else than knowing there was an error, but not really where in your syntax the error was.

Is it possible to improve this? Maybe include some characters before or after the position mentioned, and using maybe a special symbol injected into the position to symbolize from where the issue started.

If this is an error message coming from the CP (which obviously can't be modified), is it possible to dump the unaltered JSON that caused the error to the log at the same time as you output the error, so it's easier to debug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant