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: better http error handling #9

Merged
merged 7 commits into from
Dec 11, 2024
Merged

feat: better http error handling #9

merged 7 commits into from
Dec 11, 2024

Conversation

Convly
Copy link
Member

@Convly Convly commented Dec 9, 2024

What does it do?

  • Add common HTTP error classes
  • Use them in the HTTP client's fetch method to map common errors to specific classes
  • Update tests

Why is it needed?

Give more information and control in case of a an HTTP error.

Implement the validated RFC

How to test it?

  • Unit tests
  • Make a faulty request using your SDK instance, it should throw specific HTTP errors depending on the issue

@Convly Convly added pr: feature New or updates to features source: sdk-js labels Dec 9, 2024
@Convly Convly added source: sdk-error-handling Source is related to error handling and removed source: sdk-js labels Dec 9, 2024
Copy link
Contributor

@innerdvations innerdvations left a comment

Choose a reason for hiding this comment

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

Just a few questions but overall looks good!

src/http/client.ts Show resolved Hide resolved
src/http/client.ts Show resolved Hide resolved
src/http/constants.ts Show resolved Hide resolved
@Convly Convly requested a review from innerdvations December 11, 2024 09:33
Copy link
Contributor

@innerdvations innerdvations left a comment

Choose a reason for hiding this comment

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

LGTM!

@Convly Convly merged commit b86cbf9 into main Dec 11, 2024
8 checks passed
@Convly Convly deleted the feat/http-error-handling branch December 11, 2024 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: feature New or updates to features source: sdk-error-handling Source is related to error handling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants