Add initial project files
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
import { Exception } from '@adonisjs/core/exceptions'
|
||||
import type { HttpContext } from '@adonisjs/core/http'
|
||||
|
||||
export default class ApiException extends Exception {
|
||||
async handle(error: this, ctx: HttpContext) {
|
||||
ctx.response.status(error.status).send({ message: error.message, code: error.code })
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user