Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
FOGL-7959 Improve error handling for plugin load failure #1142
FOGL-7959 Improve error handling for plugin load failure #1142
Changes from all commits
3cc0062
aaeb2f6
39ebe8c
3e21c8a
8c235ea
39f8415
c27286c
b6a7fba
c68610d
6a7cd41
5d2ba61
c4dc37d
c05ebf7
b1893d3
cc0e32b
090f5a2
8dc37aa
d8a30b0
a90160c
ed9fa59
6e8754d
93cd157
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be retain fprintf to stderr also (in addition to syslog) so that errors can be seen on console also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No harm to keep specific exception type catch block here. But as we already have multi line stack trace support available at python side; So these type of errors will catch in general exception block and definitely it points to exact problem cause error.
Use multi line stack trace logger style.
_logger.error(err, "Failed to parse JSON data returned from the plugin information of {}.".format(name))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The concept here is to give the user a very clear error message they can pick up on rather than expect them to look at something more general and work out what went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Previously, if we have some invalid JSON for a plugin it raises below
ERROR: logger: fledge.services.core.api.utils: json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 2870 (char 2869)
And with the given change
ERROR: logger: fledge.services.core.api.utils: Failed to parse JSON data returned from the plugin information of PLUGIN_NAME, Expecting ',' delimiter line 1 column 2870
So the trailing message still seems to be more developer related logger.