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

feat: http transport includes more information in error message when encountering non-ok http response #340

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

gobengo
Copy link
Contributor

@gobengo gobengo commented Feb 21, 2024

Motivation:

  • there are some errors in sentry that just show up as "HTTP Request Failed", even though their root causes are probably all quite distinct. Not every caller of something that might use a ucanto client is ready to catch an HTTPError and inspect the .response property to determine what happened, and in general this may be hard because the response stream can usually only be read one time and yet that's the best way to determine the error description from the service that returned a non-ok http response. So the motivation for this change is so that our other software, when this error goes uncaught, has more distinct error messages about what's going on so they 1) share more about what's going wrong and 2) therefore also get grouped by that information in error trackers like sentry

Copy link
Collaborator

@Gozala Gozala left a comment

Choose a reason for hiding this comment

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

Sure, why not

@gobengo gobengo changed the title http transport includes more information in error message when encountering non-ok http response feat: http transport includes more information in error message when encountering non-ok http response Feb 21, 2024
@gobengo gobengo merged commit 876db91 into main Feb 21, 2024
29 of 30 checks passed
gobengo added a commit that referenced this pull request Feb 21, 2024
gobengo added a commit that referenced this pull request Feb 21, 2024
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.

2 participants