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

Check constructor argument types in Messengers and handlers #2188

Closed
eb8680 opened this issue Nov 22, 2019 · 0 comments · Fixed by #2210
Closed

Check constructor argument types in Messengers and handlers #2188

eb8680 opened this issue Nov 22, 2019 · 0 comments · Fixed by #2210
Assignees
Milestone

Comments

@eb8680
Copy link
Member

eb8680 commented Nov 22, 2019

In this topic on the forum, a user passed a mask tensor to poutine.mask as an argument poutine.mask(mask) rather than a keyword argument poutine.mask(mask=mask), attempted to use the resulting Messenger as a context manager, and got an obscure error message as a result:

ValueError: Expected mask to be a boolean but got <class ‘NoneType’>

It would be good to raise more informative error messages in such cases that would make the issue clear (in this case, raising a TypeError or ValueError when initializing the Messenger's fn attribute to something clearly not callable).

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.

1 participant