create-hokage-js-app
Version:
🔥 Best CLI tool to create a MERN stack template. Quick, clean, and customizable.
15 lines (11 loc) • 405 B
text/typescript
export class AppError extends Error {
public statusCode: number;
public isOperational: boolean;
constructor(message: string, statusCode = 500, isOperational = true) {
super(message);
this.statusCode = statusCode;
this.isOperational = isOperational;
// Maintains proper stack trace for where our error was thrown (only available on V8)
Error.captureStackTrace(this, this.constructor);
}
}