Skip to content

Consider an API which collects validation errors and raises an exception group #1011

Open
@Julian

Description

@Julian

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 errors
  • Validator.is_valid, aimed at returning no errors and indicating via a boolean whether things are OK
  • Validator.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Dialects v2Issues which will likely be addressed as part of reworked dialect supportEnhancementSome new desired functionalityError ReportingIssues related to clearer or more robust validation error reporting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions