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

Pass FileNotFoundError exceptions in likelihood through #201

Merged
merged 1 commit into from
Oct 27, 2022

Conversation

tilmantroester
Copy link
Contributor

If a likelihood raises a FileNotFoundError, for example due to a missing sacc file, that exception gets reraised as an ImportError with the likelihood file name and buries the actual missing file way up in the trace. See #173 and #175.

This PR removes the try...except block around spec.load.exec_module. FileNotFoundError now gets passed through correctly. If the actual module cannot be found, that still raises an informative exception.

@marcpaterno
Copy link
Collaborator

We plan to update the current likelihood factory scripts to provide likelihood factory functions. Until we do that, this is already a step in the right direction.

@marcpaterno marcpaterno merged commit 11435ad into master Oct 27, 2022
@marcpaterno marcpaterno deleted the 173_exception_handling branch October 27, 2022 15:02
am610 pushed a commit to am610/firecrown that referenced this pull request Nov 23, 2022
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.

None yet

2 participants