Skip to content

Improved Encoding/Decoding error descriptions #28

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

Merged

Conversation

czechboy0
Copy link
Contributor

Motivation

When an EncodingError/DecodingError is thrown and printed, we used to omit the the coding path and underlying error, which are often crucial in finding e.g. which part of the payload has a missing field.

Modifications

This PR improves the logging to include the coding path and underlying error in the output.

Result

Now when e.g. a DecodingError is thrown and printed, the default output has enough information to know which part of the JSON payload is malformed.

Test Plan

Tested manually, as we don't have unit tests for exact printing strings.

@czechboy0 czechboy0 requested a review from simonjbeaumont July 19, 2023 13:16
@czechboy0 czechboy0 merged commit e37d38d into apple:main Jul 19, 2023
@czechboy0 czechboy0 deleted the hd-improve-coding-error-descriptions branch July 19, 2023 15:04
@czechboy0 czechboy0 added the 🔨 semver/patch No public API change. label Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants