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

TASK: Improve JSON error handling #5196

Merged
merged 1 commit into from
Sep 17, 2024
Merged

Conversation

bwaidelich
Copy link
Member

Replaces all @throws JsonException annotations with a try/catch block.

Background:

Adding the @throws tag means that this exception has to be handled in the calling side. But in the affected cases the JSON that is to be en/decoded does not come from a foreign source. So an exception in those cases is very unlikely – i.e. exceptional.

Besides, throwing an expception with more context, will make ease debugging of those cases

Replaces all `@throws JsonException` annotations with a try/catch block.

Background:

Adding the `@throws` tag means that this exception has to be handled in the calling side.
But in the affected cases the JSON that is to be en/decoded does not come from a foreign source. So an exception in those cases is very unlikely – i.e. exceptional.

Besides, throwing an expception with more context, will make ease debugging of those cases
Copy link
Member

@kitsunet kitsunet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a good idea

@bwaidelich bwaidelich merged commit d51e78b into 9.0 Sep 17, 2024
10 checks passed
@bwaidelich bwaidelich deleted the task/improve-json-error-handling branch September 17, 2024 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants