UNPKG

@hermandev/dilite

Version:

Simple and lightweight Dependency Injection container for TypeScript / Next.js apps

19 lines (18 loc) 474 B
export class AppError extends Error { constructor(message, code = "APP_ERROR", status = 400) { super(message); this.message = message; this.code = code; this.status = status; } } export class ValidationError extends AppError { constructor(message) { super(message, "VALIDATION_ERROR", 422); } } export class NotFoundError extends AppError { constructor(message) { super(message, "NOT_FOUND", 404); } }