adonisjs / v6-docs

Documentation website for AdonisJS v6
38 stars 53 forks source link

docs: Update exception_handling.md #102

Closed sinh117801 closed 1 month ago

sinh117801 commented 1 month ago

In document, there's a snippet code:

import { errors } from '@vinejs/vine'

export default class HttpExceptionHandler extends ExceptionHandler {
  async handle(error: unknown, ctx: HttpContext) {
    if (error instanceof errors.E_VALIDATION_EXCEPTION) {
      ctx.response.status(422).send(error.messages)
      return
    }

    return super.handle(error, ctx)
  }
}

Actually, vine error only have E_VALIDATION_ERROR

Julien-R44 commented 1 month ago

Thanks!