@syngrisi/syngrisi
Version:
Syngrisi - Visual Testing Tool
18 lines (15 loc) • 471 B
text/typescript
class ApiError extends Error {
statusCode: number;
isOperational: boolean;
constructor(statusCode: number, message: string, isOperational: boolean = true, stack: string = '') {
super(message);
this.statusCode = statusCode;
this.isOperational = isOperational;
if (stack) {
this.stack = stack;
} else {
Error.captureStackTrace(this, this.constructor);
}
}
}
export default ApiError;