Currently, when a request fails, the module does:
It would be better to have something like:
err = new Error(body)
err.statusCode = response.statusCode
throw err
So that API consumers can identify the error type without having to check the error message string.
Currently, when a request fails, the module does:
It would be better to have something like:
So that API consumers can identify the error type without having to check the error message string.