32 lines
798 B
TypeScript
32 lines
798 B
TypeScript
import { HttpException, HttpStatus } from '@nestjs/common'
|
|
|
|
export class ApplicationException extends HttpException {
|
|
constructor(message: string, status: HttpStatus = HttpStatus.BAD_REQUEST) {
|
|
super(message, status)
|
|
}
|
|
}
|
|
|
|
export class ApplicationError extends ApplicationException {
|
|
constructor(message: string) {
|
|
super(message, HttpStatus.BAD_REQUEST)
|
|
}
|
|
}
|
|
|
|
export class NotFoundError extends ApplicationException {
|
|
constructor(message: string) {
|
|
super(message, HttpStatus.NOT_FOUND)
|
|
}
|
|
}
|
|
|
|
export class UnauthorizedError extends ApplicationException {
|
|
constructor(message: string) {
|
|
super(message, HttpStatus.UNAUTHORIZED)
|
|
}
|
|
}
|
|
|
|
export class ForbiddenError extends ApplicationException {
|
|
constructor(message: string) {
|
|
super(message, HttpStatus.FORBIDDEN)
|
|
}
|
|
}
|