sendwithus / sendwithus_nodejs

Sendwithus NodeJS Client
https://www.sendwithus.com
Apache License 2.0
22 stars 17 forks source link

`sendWithUs.send` Does not call callback when there is a network error #58

Closed neil176 closed 2 years ago

neil176 commented 2 years ago

Client version

5.1.0

Expected behaviour

The callback passed to sendWithUs.send(data, callback) should always be called

Actual behaviour

The callback is not called when there is an error that prevents any response from the server (such as ETIMEDOUT)

Steps to reproduce

Induce a network error in the request flow.

Recommendation

A .catch(err => callback(err) or similar should be added to:

https://github.com/sendwithus/sendwithus_nodejs/blob/master/lib/sendwithus.js#L150-L154

rob-swu commented 2 years ago

Thanks for bringing this to our attention. We will add this within the next two weeks, I'll link back to the issue with the PR when it's available

rob-swu commented 2 years ago

this has been covered in the 6.0.0 release done in PR #61