Closed ggrossetie closed 3 years ago
Actually, both response
and responseText
are empty when an error occurred in asynchronous mode...
Since we are not running in the browser, if we return an empty response
and responseText
the caller won't know why the request failed. I think it's a fair trade-off to set the stringify error in responseText
.
Alternatively, we could add a non-standard field with the error. For instance, onerror
is called with a ProgressEvent
. We could add an error field on this object to pass the error.
I've decided to pass the error as a parameter of the onerror
callback function, see #34.
resolves #30