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

Use custom exception when xyxymatch fails #33

Closed
braingram opened this issue Apr 18, 2024 · 1 comment · Fixed by spacetelescope/tweakwcs#204
Closed

Use custom exception when xyxymatch fails #33

braingram opened this issue Apr 18, 2024 · 1 comment · Fixed by spacetelescope/tweakwcs#204

Comments

@braingram
Copy link

Similar to: spacetelescope/tweakwcs#202

Both jwst and roman pipelines catch an exception that originates in this package:

"Number of output coordinates exceeded allocation (%d)",

Using a custom exception (that subclasses RuntimeError to maintain backwards-compatibility) would allow the pipelines to catch this specific error without testing the error message.

@mcara
Copy link
Member

mcara commented Apr 19, 2024

Exception type is set here:

PyErr_SetString(PyExc_RuntimeError, stimage_error_get_message(&error));
. IMO it is not worth the effort to modify this code to do string parsing here and defining custom exceptions in C code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants