Skip to content

Pass original validation error if boom #3147

@hueniverse

Description

@hueniverse

Previously, hapi would always override any validation error and return a 400. This changes it to keep the error object if it is a boom error with its own status code and pass that instead. Same error decorations apply.

It is considered a bug because it should have honored the returned error with its own status code already. It is an enhancement because it allows new use cases with returning custom errors in validation rules.

Is it marked as breaking because it might cause custom code not using joi rules but one that does use boom errors to return different error codes. However, it will still return an error and therefore this is published as a minor release, not a major.

Metadata

Metadata

Assignees

Labels

breaking changesChange that can breaking existing codebugBug or defectfeatureNew functionality or improvement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions