1.0.2 • Published 5 years ago
@yo1dog/http-response-error v1.0.2
http-response-error
HTTP Response Error
Quick Start
const HTTPResponseError = require('@yo1dog/http-response-error');
const res = await request('https://www.example.com/fubar');
if (res.statusCode !== 200) {
throw new HTTPResponseError(res, `Unable to get fubar.`);
}
Docs
new HTTPResponseError(res, [message])
param | type | description |
---|---|---|
res | Response | Response object. |
message | string | A human-readable description of the error. |