Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Remove 'except Exception' guard from TraitType.clone #1696

Open
mdickinson opened this issue Aug 10, 2022 · 0 comments
Open

Remove 'except Exception' guard from TraitType.clone #1696

mdickinson opened this issue Aug 10, 2022 · 0 comments
Labels
component: core Issues related to the core library type: refactor

Comments

@mdickinson
Copy link
Member

mdickinson commented Aug 10, 2022

[From #1645]

Currently, in most cases TraitType.clone with a new default value tries to validate that default value using self.validate(None, None, default_value). This can fail for trait types like This which need a proper object and name for correct validation, so this code executes inside a try / except Exception wrapper.

Those trait types should override clone to implement their own behaviour, and then we can remove the catch-all-exceptions logic.

@mdickinson mdickinson added type: refactor component: core Issues related to the core library labels Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: core Issues related to the core library type: refactor
Projects
None yet
Development

No branches or pull requests

1 participant