UNPKG

@athenna/http

Version:

The Athenna Http server. Built on top of fastify.

20 lines (19 loc) 616 B
/** * @athenna/http * * (c) João Lenon <lenon@athenna.io> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ import { HttpException } from '#src/exceptions/HttpException'; export class ZodValidationException extends HttpException { constructor(error) { const name = 'ValidationException'; const code = 'E_VALIDATION_ERROR'; const status = 422; const message = 'Validation error happened.'; const details = error.issues; super({ name, message, status, code, details }); } }