UNPKG

get-express-starter

Version:

Get production ready express boilerplate with a single command

17 lines (14 loc) 392 B
export class ApiError extends Error { statusCode: number; isOperational: boolean; constructor(statusCode: number, message: string, isOperational = true, stack = '') { super(message); this.statusCode = statusCode; this.isOperational = isOperational; if (stack) { this.stack = stack; } else { Error.captureStackTrace(this, this.constructor); } } }