Hi!
Currently the server response is sent with the callbacks, so I think you should be getting 401, 404, 406 or other error code that is in a server response, as is done in some test cases (see
this).
If there's other error while the request is being stablished (not related to a server response), it will only print it on the console, and return "undefined" as you point out.
We are planning on revising all error reporting & exception handling in the upcoming versions.
I have created an
issue in the github repository for this.
Thanks!
Edgar