Skip to content

Consider making DecodeError and ValidationError inherit from ValueError #634

Closed

Description

@vytas7

Description

In many scenarios and libraries one assumes that validation errors inherit from ValueError, however, msgspec's exception classes do not. Would it be possible to make DecodeError and ValidationError subclasses of ValueError somewhere in the hierarchy?

Activity

  1. changed the title [-]Consider making `DecodeError` and `ValidationError` inherit from ValueError[/-] [+]Consider making `DecodeError` and `ValidationError` inherit from `ValueError`[/+] on Jan 20, 2024
  2. jcrist commented on Jan 21, 2024

    @jcrist
    Member

    Makes sense to me, happy to make this change. This would be a breaking change of course, but since we're still in 0.* that shouldn't be unexpected.

  3. Siyet commented on Apr 8, 2026

    @Siyet
    Contributor

    Ported to the community fork msgspec-arise: issue #27, PR #34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions