class AppError extends Error { constructor(message, statusCode, isOperational = true, errors = null) { super(message); this.statusCode = statusCode; this.isOperational = isOperational; this.errors = errors; Error.captureStackTrace(this, this.constructor); } } module.exports = AppError;