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

Add error details to invalid JetStream JSON errors #5868

Merged

Conversation

caspervonb
Copy link
Contributor

@caspervonb caspervonb commented Sep 9, 2024

Currently failures to unmarshal only give a vague error of "invalid JSON", this adds the original error to it as context.

Before:

invalid JSON

After:

invalid JSON: invalid character '\"' after object key

Related to but not dependent on #5858

Signed-off-by: Casper Beyer [email protected]

@caspervonb caspervonb marked this pull request as ready for review September 9, 2024 12:32
@caspervonb caspervonb requested a review from a team as a code owner September 9, 2024 12:32
Copy link
Member

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

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

@ripienaar This ok to add in to existing error or should we add a new one?

@ripienaar
Copy link
Contributor

ripienaar commented Sep 11, 2024

We've done is often enough that one more won't make it worse :) If used correctly the text is designed to be changed and improved over time for user friendliness. Error checks should be done against the number essentially.

Copy link
Contributor

@ripienaar ripienaar left a comment

Choose a reason for hiding this comment

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

LGTM

@derekcollison derekcollison merged commit 054c03a into main Sep 11, 2024
5 checks passed
@derekcollison derekcollison deleted the add-error-details-to-invalid-jetstream-json-error branch September 11, 2024 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants