Skip to content

Comments

Fix broken error handling for unregistered task/recipe lookup#216

Open
kirklandsign wants to merge 1 commit intohuggingface:mainfrom
kirklandsign:fix-dict
Open

Fix broken error handling for unregistered task/recipe lookup#216
kirklandsign wants to merge 1 commit intohuggingface:mainfrom
kirklandsign:fix-dict

Conversation

@kirklandsign
Copy link

dict.get() returns None on missing keys instead of raising KeyError, making the except KeyError block dead code. An invalid task or recipe would fall through as None and later crash with an unhelpful TypeError: 'NoneType' object is not callable.

Replace with an explicit membership check that surfaces the available task/recipe names in the error message.

`dict.get()` returns `None` on missing keys instead of raising
`KeyError`, making the `except KeyError` block dead code. An invalid
task or recipe would fall through as `None` and later crash with an
unhelpful `TypeError: 'NoneType' object is not callable`.

Replace with an explicit membership check that surfaces the available
task/recipe names in the error message.

Co-authored-by: Claude <noreply@anthropic.com>
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