Function
validationErrorResponseFromError
(
error: unknown,
message = 'Validation error',
status = 400
)
Source from the content-addressed store, hash-verified
| 84 | } |
| 85 | |
| 86 | export function validationErrorResponseFromError( |
| 87 | error: unknown, |
| 88 | message = 'Validation error', |
| 89 | status = 400 |
| 90 | ): NextResponse<ValidationErrorBody> | null { |
| 91 | if (!isZodError(error)) return null |
| 92 | return validationErrorResponse(error, message, status) |
| 93 | } |
| 94 | |
| 95 | const REQUEST_BODY_LABEL = 'Request body' |
| 96 | |
Tested by
no test coverage detected