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

Errors failing to surface when deserializing json #63

Open
tvelich opened this issue Nov 15, 2022 · 0 comments
Open

Errors failing to surface when deserializing json #63

tvelich opened this issue Nov 15, 2022 · 0 comments

Comments

@tvelich
Copy link

tvelich commented Nov 15, 2022

Client version

6.0.1

Expected behaviour

Errors throw/contain actual reason for request failure

Actual behaviour

Error complains about invalid json (even though content type is text/html): Unexpected end of JSON input at https://github.com/sendwithus/sendwithus_nodejs/blob/master/lib/sendwithus.js#L69

Steps to reproduce

To demonstrate with a 403 just require('sendwithus')().send({}, (err) => console.log(err)) in a node console and it'll fail with this obscure error

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

No branches or pull requests

1 participant