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