get-uri
Version:
Returns a `stream.Readable` from a URI string
12 lines • 413 B
JavaScript
import { STATUS_CODES } from 'http';
/**
* Error subclass to use when an HTTP application error has occurred.
*/
export default class HTTPError extends Error {
constructor(statusCode, message = STATUS_CODES[statusCode]) {
super(message);
this.statusCode = statusCode;
this.code = `E${String(message).toUpperCase().replace(/\s+/g, '')}`;
}
}
//# sourceMappingURL=http-error.js.map