Files
Checkmate/server/src/utils/AppError.ts
T

24 lines
572 B
TypeScript
Raw Normal View History

2026-01-09 14:49:44 -08:00
export interface AppErrorConfig {
message: string;
status?: number;
service?: string | null;
method?: string | null;
details?: any;
}
export class AppError extends Error {
private status: number;
private service: string | null;
private method: string | null;
private details: any;
constructor({ message, status = 500, service = null, method = null, details = null }: AppErrorConfig) {
super(message);
this.status = status;
this.service = service;
this.method = method;
this.details = details;
Error.captureStackTrace(this, this.constructor);
}
}