micronaut-serialization
micronaut-serialization copied to clipboard
Ability to customize error messages
Feature description
Currently we obtain something like:
Unable to decode request body: Error decoding JSON stream for type [res]: Error decoding property [<some class> property1] of type [class <some class>]: Error decoding property [<some other class> property1] of type [class <some other class>]: Unexpected token VALUE_STRING, expected START_OBJECT
We wanted to be able to customize something like:
Invalid json for <fieldName> for class <class name>
You can customize the error handling https://docs.micronaut.io/latest/guide/index.html#errorHandling
Is it possible to add the Target Class to the Exception?
atm the type is part of the message but not exposed as a field on the SerdeException. we could add a subtype that makes this accessible.