Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add typed IteratorError#685

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
btnmasher wants to merge1 commit intojson-iterator:master
base:master
Choose a base branch
Loading
frombtnmasher:add-typed-iterator-error

Conversation

@btnmasher
Copy link

@btnmasherbtnmasher commentedAug 30, 2023
edited
Loading

This PR adds a typedIteratorError which enables consumers to check against jsonitor iterator errors viaerrors.As (directly or if the error itself is wrapped), as well as provide the additional context fields about the error to use in formatting their error messages in their preferred fashion.

This functionality is roughly comparable to stdlib'sjson.SyntaxError, which jsonitor does not currently have an equivalent. This has caused some headaches with my use of gin and it's JSON Binding mechanisms with gin's build tags set to supplant the stdlib json parser with jsonitor. Error reporting mechanisms which check forjson.SyntaxErrors to aid in formatting user-presentable, helpful error messages in my APIs cannot easily detect jsonitor's iterator error messages because until this PR the error messages were untyped, generic error strings.

This change should be a transparent to existing consumers as theIteratorError type conforms toerror interface with the same message syntax as prior to this change.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@btnmasher

[8]ページ先頭

©2009-2025 Movatter.jp