Skip to content

Bug: validation module should return 400 on error #1298

Closed
@scottgerring

Description

@scottgerring

When you use the @Validation annotation on a RequestHandler and the provided message does not validate, the module will throw a ValidationException, resulting in a 500 back to the client.

Changing this behaviour is a breaking change.

What were you trying to accomplish?
I would expect that validation errors should return a 400 and a description of why the validation failed. Alternatively if the annotation is applied to something other than a RequestHandler, throwing an exception for the user's code to catch seems reasonable.

Current Behavior

ValidationException / HTTP 500 returned to user.

Possible Solution

Steps to Reproduce (for bugs)

Check out the validation example as it exhibits this behaviour.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingstatus/staged-major-releaseThis change will go with the next major releasev2Version 2

Type

No type

Projects

Status

Coming soon

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions