Skip to content

Wrap errors in dataclass/attrs post-init methods - #472

Merged
jcrist merged 1 commit into
mainfrom
wrap-error-dataclass-post-init
Jul 6, 2023
Merged

Wrap errors in dataclass/attrs post-init methods#472
jcrist merged 1 commit into
mainfrom
wrap-error-dataclass-post-init

Conversation

@jcrist

@jcrist jcrist commented Jul 6, 2023

Copy link
Copy Markdown
Member

When decoding/converting to a dataclass/attrs type with a __post_init__/__attrs_post_init__ method, we now wrap all ValueError/TypeError exceptions in a ValidationError. This mirrors the behavior used in the new Struct.__post_init__ support, and helps provide more uniform error handling support.

When decoding/converting to a dataclass/attrs type with a
`__post_init__`/`__attrs_post_init__` method, we now wrap all
`ValueError`/`TypeError` exceptions in a `ValidationError`. This mirrors
the behavior used in the new `Struct.__post_init__` support, and helps
provide more uniform error handling support.
@jcrist
jcrist merged commit 524de6b into main Jul 6, 2023
@jcrist
jcrist deleted the wrap-error-dataclass-post-init branch July 6, 2023 03:44
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.

1 participant