Skip to content

fix wrapping ValidationError and DecodeError in ValidationError in dec_hook #1012 - #1013

Merged
jcrist merged 2 commits into
msgspec:mainfrom
provinzkraut:fix-1012
Apr 10, 2026
Merged

fix wrapping ValidationError and DecodeError in ValidationError in dec_hook #1012#1013
jcrist merged 2 commits into
msgspec:mainfrom
provinzkraut:fix-1012

Conversation

@provinzkraut

@provinzkraut provinzkraut commented Apr 10, 2026

Copy link
Copy Markdown
Member

Fix #1012.

Fix a regression introduced in #790 that would cause ValidationError and DecodeError raise in dec_hook to be wrapped in ValidationError again.

@provinzkraut provinzkraut changed the title fix fix #1012 Apr 10, 2026
@provinzkraut provinzkraut changed the title fix #1012 fix wrapping ValidationError and DecodeError in ValidationError in dec_hook #1012 Apr 10, 2026
@jcrist

jcrist commented Apr 10, 2026

Copy link
Copy Markdown
Member

Thanks for this! Going to push a quick fixup, but this is almost good to go.

@provinzkraut

Copy link
Copy Markdown
Member Author

Ah, good catch with the unnecessary check. I initially only checked for ValidationError and only added DecodeError later. Didn't backtrack to think if this still makes sense. Thanks!

@jcrist
jcrist merged commit 4ce20fa into msgspec:main Apr 10, 2026
22 checks passed
@Siyet Siyet mentioned this pull request Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exceptions inheriting from ValidationError raised in dec_hook implicitly wrapped in another ValidationError post 0.21.0

2 participants