Skip to content

feat: Better treatment of errors from the API#389

Merged
vcapretz merged 1 commit intocanaryfrom
feature/eng-2672-wrap-node-sdk-fetch-method-in-a-trycatch-block-to-return
Jun 25, 2024
Merged

feat: Better treatment of errors from the API#389
vcapretz merged 1 commit intocanaryfrom
feature/eng-2672-wrap-node-sdk-fetch-method-in-a-trycatch-block-to-return

Conversation

@vcapretz
Copy link
Contributor

  • do not throw when fetch itself fails due to being unable to resolve the connection
  • throw better error message when the response is not a valid JSON

also closes #347

- do not throw when `fetch` itself fails due to being unable to resolve the connection
- throw better error message when the response is not a valid JSON
@vcapretz vcapretz self-assigned this Jun 21, 2024
@vcapretz vcapretz requested a review from a team as a code owner June 21, 2024 13:12
fetchMock.mockOnce('local_rate_limited', {
status: 422,
headers: {
Authorization: 'Bearer re_924b3rjh2387fbewf823',

Check failure

Code scanning / CodeQL

Hard-coded credentials

The hard-coded value "Bearer re_924b3rjh2387fbewf823" is used as [authorization header](1).
@vcapretz vcapretz merged commit b477c48 into canary Jun 25, 2024
@vcapretz vcapretz deleted the feature/eng-2672-wrap-node-sdk-fetch-method-in-a-trycatch-block-to-return branch June 25, 2024 15:05
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.

client should handle raw html load balancer error responses

2 participants