import { Exception } from '@adonisjs/core/build/standalone'

/*
|--------------------------------------------------------------------------
| Exception
|--------------------------------------------------------------------------
|
| The Exception class imported from `@adonisjs/core` allows defining
| a status code and error code for every exception.
|
| @example
| new BadRequestException('message', 500, 'E_RUNTIME_EXCEPTION')
|
*/
export class BadRequestException extends Exception {
    constructor(message: string = 'Bad Request') {
        super(message, 400, 'E_BAD_REQUEST')
    }
}

export class InternalServerException extends Exception {
    constructor(message: string = 'Internal Server Error') {
        super(message, 500, 'E_INTERNAL_SERVER_ERROR')
    }
}
