17 lines
498 B
TypeScript
17 lines
498 B
TypeScript
import { HttpStatusCode } from 'axios';
|
|
|
|
class UnableToProceed extends Error {
|
|
public httpErrorStatusCode = HttpStatusCode.BadRequest;
|
|
constructor(msg: string, customErrorCode?: typeof HttpStatusCode) {
|
|
super(msg);
|
|
this.name = 'UnableToProceed';
|
|
|
|
this.httpErrorStatusCode = this.httpErrorStatusCode ?? customErrorCode;
|
|
|
|
// Set the prototype explicitly.
|
|
Object.setPrototypeOf(this, UnableToProceed.prototype);
|
|
}
|
|
}
|
|
|
|
export default UnableToProceed;
|