jcrist / msgspec

A fast serialization and validation library, with builtin support for JSON, MessagePack, YAML, and TOML

Home Page:https://jcristharif.com/msgspec/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Consider making `DecodeError` and `ValidationError` inherit from `ValueError`

vytas7 opened this issue · comments

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?

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.