remove ErrorWithStatusCode

This commit is contained in:
Tim Alby 2019-07-05 15:23:52 +02:00
parent c63cc52fda
commit 9c1b48a5e4

View file

@ -50,23 +50,6 @@ class ErrorTypeError extends Error {
}
}
/**
* Base class for errors with a corresponding HTTP status code.
*
* @extends ErrorTypeError
*/
class ErrorWithStatusCode extends ErrorTypeError {
/**
* @param {?number} statusCode an HTTP status code
* @param {object} options as for ErrorTypeError
*/
constructor ({ statusCode, ...options }) {
super(options)
this.statusCode = statusCode || 500
}
}
exports.ErrorWithStatusCode = ErrorWithStatusCode
/**
* Return the `info` property from `error` and recursively merge the `info`
* properties from the error's causes, if any.