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

Allow Python to catch errors #38

Open
Leengit opened this issue Jun 6, 2022 · 2 comments
Open

Allow Python to catch errors #38

Leengit opened this issue Jun 6, 2022 · 2 comments

Comments

@Leengit
Copy link
Collaborator

Leengit commented Jun 6, 2022

The current use of itkAssertOrThrowMacro to report errors, such as inputs that cannot be processed, is not caught by a Python try-except block. We want a solution where the Python program can recover from these errors.

@andreped
Copy link

andreped commented Jun 6, 2022

That would be a great feature. I was looking into using ITKColorNormalization in my DP workflows, but I was unable to as it seemed to crash too often, with no simple way to catch these errors, as fair as I remember.

I could test a proposed solution in a typical workflow when it is ready.

@Leengit
Copy link
Collaborator Author

Leengit commented Jul 4, 2022

InsightSoftwareConsortium/ITK#3479 should fix this issue. However, I nonetheless recommend that we use if (!success) { itkGenericExceptionMacro(message); } to replace itkAssertOrThrowMacro(success, message); in ITKColorNormalization code.

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

No branches or pull requests

2 participants