A base trait for error codes, all error codes need to extend this.
A base trait for error codes, all error codes need to extend this. It's available for you so you can add more in your app
Assumes your error codes will always be case objects.
Encapsulates a field name for use in a validation error
Encapsulates a field name for use in a validation error
The name of the field
Encapsulates errors in an API
Encapsulates errors in an API
The message for this error
An optional field name, useful when it applies to a particular field
Decouple business logic error types from http errors
Optional args, these need to be serializable to json if you're using the org.scalatra.validation.ValidationErrorSerializer
Serializes a validation error into a structure:
{ "message": "the error message", "field": "field_name", "code": "ValidationFail", "args": [] }
Serializes a validation error into a structure:
{ "message": "the error message", "field": "field_name", "code": "ValidationFail", "args": [] }
You can configure whether or not to include the args. And on the way in it assumes args are JValues. The fields: field, code and args are only added if they have actual data.
Allows for unordered building of org.scalatra.validation.ValidationError