Handler.ts 925 B

12345678910111213141516171819202122232425262728
  1. /*
  2. |--------------------------------------------------------------------------
  3. | Http Exception Handler
  4. |--------------------------------------------------------------------------
  5. |
  6. | AdonisJs will forward all exceptions occurred during an HTTP request to
  7. | the following class. You can learn more about exception handling by
  8. | reading docs.
  9. |
  10. | The exception handler extends a base `HttpExceptionHandler` which is not
  11. | mandatory, however it can do lot of heavy lifting to handle the errors
  12. | properly.
  13. |
  14. */
  15. import Logger from '@ioc:Adonis/Core/Logger'
  16. import HttpExceptionHandler from '@ioc:Adonis/Core/HttpExceptionHandler'
  17. import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
  18. export default class ExceptionHandler extends HttpExceptionHandler {
  19. constructor() {
  20. super(Logger)
  21. }
  22. public async handle(error: any, ctx: HttpContextContract) {
  23. await super.handle(error, ctx)
  24. }
  25. }