export default class ApiError extends Error {
status;
errors;
constructor(status: number, message: string, errors:any[] = []) {
super(message);
this.status = status;
this.errors = errors;
Object.setPrototypeOf(this, ApiError.prototype);
}
static BadRequest(message:string, errors:any[] = []) {
return new ApiError(400, message, errors);
}
}