romaricdrigon/MetaYaml

Aggregate errors?

Closed this issue · 3 comments

Hi,

Is it possible to aggregate the errors messages then throw an exception instead of the first one?

Hello,

At the moment its not possible in the library.
Adding it is possible, it requires (only) a little coding.

At the moment, NodeValidatorExceptions are thrown all around NodeValidators.
Instead we could instead introduce add a raiseError method in the SchemaValidator, requiring something like a NodeValidatorError object. Each node has access to the SchemaValidator, so it can call this method. It can then decide what to do. Making configurable either to die with an exception on the first error or to report an array of all errors would be supra-nice.

ok, I will probably have a good at doing that at some point then, thanks for the library :)

At the moment I'm closing the issue, feel free to ask if anything else & send a PR when ready :)