Matthew Martin β β π on Nostr: Someone force a bot to read all the text on the internet and now it thinks error ...
Someone force a bot to read all the text on the internet and now it thinks error handling in python is:
- convert it to a behavior that isn't an exception, e.g. a print statement (Chatty `pass`)
- rarely:log it and reraise it
- rarely:log it and replace with a different `Exception`
I can tell because that is how it writes methods and tests for methods.
How else could it be?
- Exceptions as control-of-flow, maybe like this, with a distinction between panic & recoverable
https://www.youtube.com/watch?v=Z3j-jWX7B4M
- convert it to a behavior that isn't an exception, e.g. a print statement (Chatty `pass`)
- rarely:log it and reraise it
- rarely:log it and replace with a different `Exception`
I can tell because that is how it writes methods and tests for methods.
How else could it be?
- Exceptions as control-of-flow, maybe like this, with a distinction between panic & recoverable
https://www.youtube.com/watch?v=Z3j-jWX7B4M