@hermandev/dilite
Version:
Simple and lightweight Dependency Injection container for TypeScript / Next.js apps
22 lines (19 loc) • 442 B
text/typescript
export class AppError extends Error {
constructor(
public message: string,
public code: string = "APP_ERROR",
public status: number = 400,
) {
super(message);
}
}
export class ValidationError extends AppError {
constructor(message: string) {
super(message, "VALIDATION_ERROR", 422);
}
}
export class NotFoundError extends AppError {
constructor(message: string) {
super(message, "NOT_FOUND", 404);
}
}