-
Notifications
You must be signed in to change notification settings - Fork 2
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
Improved feedback in case of JSON exceptions wanted #279
Comments
Hi @namsonx , |
Hi Son, my function require some adaptions. I will change the implementation and make a pull request for the JsonPreprocessor within today. Then it's on you to make a review and check for side effects that possibly I have overlooked. After this we can decide if this already for 0.11 or not. |
Hello Holger, Your solution looks great especially for end users who will know where they made a mistake in JSON configuration files. Sure, we will check for side effects then decide if it already for 0.11 or not. Thank you, |
In case of JSON syntax errors the log file contains an extract of the JSON content nearby the position, where the error occurred. Realizes: #279
In case of JSON syntax errors in configuration files, the Robot Framework log files contain an extract of the JSON content nearby the position, where the error occurred. Reacts on: test-fullautomation/python-jsonpreprocessor#279
Retest successful. Issue can be closed. |
integrated in RobotFramework AIO 0.11.0 |
I always hesitate about JSON errors like that:
Expecting value: line 13 column 15 (char 522)
or
Expecting ',' delimiter: line 4 column 4 (char 76)
How to find the indicated position? What exactly is the JSON code that is used as reference for the counting? Also in case of imported JSON files are involved. Also in case of the entire JSON code is placed in one single line only. Does the counting include code that is commented out?
In my opinion a better support is required here. This is my solution:
It's simple to adapt the JsonPreprocessor to use this function.
Original code:
Adaption:
If this is JSON code containing an error (123 not encapsulated in quotes):
This is the result:
What do you think?
The text was updated successfully, but these errors were encountered: