msgspec icon indicating copy to clipboard operation
msgspec copied to clipboard

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

Open vytas7 opened this issue 1 year ago • 1 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?

vytas7 avatar Jan 20 '24 17:01 vytas7

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.

jcrist avatar Jan 21 '24 21:01 jcrist