Skip to content

Standardize Validation Error #4605

@metcoder95

Description

@metcoder95

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the issue has not already been raised

Issue

While listing the errors subject to be replaced by native FastifyErrors, I completely missed the Error object that is raised out of a Validation Error of an incoming request:

fastify/lib/validation.js

Lines 135 to 139 in ec17333

const error = schemaErrorFormatter(result, dataVar)
error.statusCode = error.statusCode || 400
error.validation = result
error.validationContext = dataVar
return error

The issue is to open the chat about if this Error should also be subject to a native FastifyError object by default.

Reference: #4602

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions