Skip to content

fix: suppress misleading KeyError chain in _locate_site_class`#1270

Open
blankirigaya wants to merge 3 commits intomalariagen:masterfrom
blankirigaya:exc
Open

fix: suppress misleading KeyError chain in _locate_site_class`#1270
blankirigaya wants to merge 3 commits intomalariagen:masterfrom
blankirigaya:exc

Conversation

@blankirigaya
Copy link
Copy Markdown
Contributor

In _locate_site_class (snp_data.py), when an unsupported site_class value is passed, the NotImplementedError was chained to exc — a KeyError from a cache dict lookup that is purely a normal cache-miss signal, not an error.

This caused misleading tracebacks like:

KeyError: ('some_region', None, 'BAD_CLASS')
During handling of the above exception, another exception occurred:
NotImplementedError: BAD_CLASS

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.

1 participant