Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom mapper for schema validation errors

I've used camel validator and I'm catching errors from the schema validation like a :

org.xml.sax.SAXParseException: cvc-minLength-valid: Value '' with length = '0' is not facet-valid with respect to minLength '1' for type

Is it any tool which will be good to map this errors for a prettier statements? I can always just iterate on the erros, split on them and prepare custom mapper, but maybe there is sth better than this? :)

like image 223
Marcin Erbel Avatar asked May 16 '26 20:05

Marcin Erbel


2 Answers

Saxon is really good at error reporting. Its validator gives you understandable messages in the first place.

like image 128
Florent Georges Avatar answered May 18 '26 08:05

Florent Georges


That's a SAX error message, and it appears to be quite clearly stated, but see ErrorHandler and DefaultHandler to customize it however you'd prefer.

like image 20
kjhughes Avatar answered May 18 '26 10:05

kjhughes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!