Consider an API which collects validation errors and raises an exception group #1011
Labels
Dialects v2
Issues which will likely be addressed as part of reworked dialect support
Enhancement
Some new desired functionality
Error Reporting
Issues related to clearer or more robust validation error reporting
Python 3.11 now supports exception groups for grouping together multiple (simultaneous, unrelated) exceptions.
This seems to suit us -- right now we have:
Validator.iter_errors
, aimed at returning (not raising) all errorsValidator.is_valid
, aimed at returning no errors and indicating via a boolean whether things are OKValidator.validate
, aimed at raising 1 single exception (the first encountered one)Another API where we raise all exceptions
iter_errors
would have returned seems like it may fit the picture.Reviewing the notes API to see if we should make any use of it is likely also wise.
The text was updated successfully, but these errors were encountered: