-
-
Notifications
You must be signed in to change notification settings - Fork 175
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
CatchedException is not a valid exception #338
Comments
I may have misunderstood how these objects are meant to be used. I see we need to return, not raise, Can both methods be considered valid? If so, then I suspect more work is needed to handle them differently when caught. |
I guess the name might be misleading. Yes, TaskFailed must be returned not raised. On the other hand you can raise any exception to fail a task. The only difference is that you get simple error message or a full traceback. |
Maybe docs should have an example showing why & how this feature should be used. |
An example use would be helpful. Also, throwing a special exception is a common API choice; eg click has a hierarchy of exceptions it’ll catch, and you can throw one deep into a call stack and get a nicely formatted message and no traceback. I’d still love for the As for naming: grammatically speaking it’d be Can I also ask why do the |
A If my memory is correct So for your use-case to throw one exception deep into a call we would probably need to create a set of new classes really derived from python And since |
fixed in f0581bc |
Describe the bug
CatchedException
does not inherit fromException
and so is not a valid exception in Python 3; see PEP 352. ATypeError
is raised if you try to raise it or a subclass:This results in a typeerror on any Python 3.x version:
The fix is to inherit from
Exception
:Upvote & Fund
The text was updated successfully, but these errors were encountered: