Skip to content

Conversation

@wfchandler
Copy link
Contributor

Currently CLI clients will panic if the json-body file cannot be read or cannot be deserialized.

Update these to return errors and add additional context.

Currently CLI clients will panic if the `json-body` file cannot be read
or cannot be deserialized.

Update these to return errors and add additional context.
@wfchandler wfchandler force-pushed the wc/handle-json-failure branch from 86fb5e1 to 253437e Compare November 11, 2025 19:19
@wfchandler wfchandler requested a review from ahl November 11, 2025 20:28
Copy link
Collaborator

@ahl ahl left a comment

Choose a reason for hiding this comment

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

sure!

&body_txt,
)
.unwrap();
.with_context(|| format!("failed to deserialize {} as JSON", value.display()))?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

we could probably make this message more accurate

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made the message a bit simpler, and hopefully easier for users to follow.

@wfchandler wfchandler merged commit 132a79a into main Nov 14, 2025
9 checks passed
@wfchandler wfchandler deleted the wc/handle-json-failure branch November 14, 2025 21:28
abus-sh pushed a commit to abus-sh/progenitor that referenced this pull request Dec 5, 2025
Currently CLI clients will panic if the `json-body` file cannot be read
or cannot be deserialized.

Update these to return errors and add additional context.
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.

3 participants