Closed yafeng520 closed 7 months ago
Seeing the same issue. I think this issue is across both better exceptions module and rich traceback too. It does not work across threads, and only works within the main thread
I had the same problem too. When using this with sse_starlette
which runs tasks in TaskGroup
it will not trace exceptions in the tasks, leaving me frustrated for hours because of unable to find anything useful in the traceback.
I want to know if any library can handle exceptions in separate thread.
Eh yeah, this is to be expected. There's nothing magic that we're doing here. You'd have to re-initialize better-exceptions in each thread/child process you're spawning. They're going to behave as though they're fresh processes.
Unless I'm missing something, this is expressly out of scope for the project :/ Sorry about that.
code of running in the child process
result
code of running in the main process
result