Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

transform_error's format_exception parameter is not passed down recursively #389

Closed
oc-ben-ellis opened this issue Jun 20, 2023 · 3 comments

Comments

@oc-ben-ellis
Copy link

  • cattrs version: 23.1.2
  • Python version: 3.10.9
  • Operating System: WSL2 - Ubuntu

Description

I'd expect when I call,

transform_error(ex, format_exception=my_format_exception_handler)

I would expect my_format_exception_handler callable to be called and the return value applied to to all exceptions.

However, as it recursively calls itself without passing on the format_exception parameter, it uses the default format_exception callable instead of the one I passed in.

@Tinche
Copy link
Member

Tinche commented Jun 21, 2023

Eep, you're right.

@BEllis
Copy link
Contributor

BEllis commented Jun 23, 2023

Eep, you're right.

@Tinche happy for this to be closed unless you normally wait for the release?

@Tinche
Copy link
Member

Tinche commented Jun 23, 2023

Yeah we can close, I'll release in the next couple of weeks. Thanks!

@Tinche Tinche closed this as completed Jun 23, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants