Message340520
This has been commented on numerous times by others (https://stackoverflow.com/questions/2829329/catch-a-threads-exception-in-the-caller-thread-in-python, http://benno.id.au/blog/2012/10/06/python-thread-exceptions, to name a few), but there is no in-built mechanism in threading to catch an unhandled exception thrown by a thread. The default behavior of dumping to stderr is completely useless for error handling in many scenarios. Solutions do exist, but I have yet to see one that is not exceptionally complicated. It seems like checking for exceptions should be a very basic part of any threading library. The simplest solution would be to just have the Thread store any unhandled exceptions and have them raised by Thread.join(). There could also be additional methods to check if exceptions were raised. |
|
| Date |
User |
Action |
Args |
| 2019-04-19 01:36:15 | Joel Croteau | set | recipients:
+ Joel Croteau |
| 2019-04-19 01:36:15 | Joel Croteau | set | messageid: <[email protected]> |
| 2019-04-19 01:36:15 | Joel Croteau | link | issue36666 messages |
| 2019-04-19 01:36:15 | Joel Croteau | create | |
|