-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Hi,
We noticed that sometimes the service returns 500/502 errors and the response body is html.
The code doesn't check the status code and tries to parse the body as json, which fails with the error "SdkError: Failed to parse JSON response".
Context:
fingerprintjs-pro-server-api-node-sdk/src/serverApiClient.ts
Lines 86 to 91 in 0feaf6b
| const response = await this.fetch(url, { | |
| method: 'GET', | |
| headers, | |
| }) | |
| const jsonResponse = await copyResponseJson(response) |
It would be nice to handle these cases so we can get a meaningful and correct error back.
I'll be happy to submit a PR if needed.
Thanks!
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working