xh / hoist-core

🏗️ The XH Hoist toolkit for Grails
https://xh.io/
Apache License 2.0
7 stars 2 forks source link

`ExceptionHandler` should auto-wrap Grails `ValidationException` to get human-readable message #417

Open amcclain opened 1 month ago

amcclain commented 1 month ago

In RestController we catch/wrap Grails GORM ValidationExceptions in our own Hoist version of the same - the Hoist class processes the message into something that's actually readable.

https://github.com/xh/hoist-core/blob/develop/grails-app/controllers/io/xh/hoist/RestController.groovy#L76

Any reason not to always do this within ExceptionHandler so it is the default serialization for that class of exceptions?