freshyo/apps/backend/src/lib/api-error.ts
2026-03-27 18:47:12 +05:30

14 lines
362 B
TypeScript
Executable file

export class ApiError extends Error {
public statusCode: number;
public details?: any;
constructor(message: string, statusCode: number = 500, details?: any) {
console.log(message)
super(message);
this.name = 'ApiError';
this.statusCode = statusCode;
this.details = details;
// Error.captureStackTrace?.(this, ApiError);
}
}