3 ms·
Yes i have hit this too. My planned goto approach if I was on a prod app instead of a toy, is to use something like `result`, but with the `Err` variant modded
by akdor1154 4y ago
Yes i have hit this too.
My planned goto approach if I was on a prod app instead of a toy, is to use something like `result`, but with the `Err` variant modded to generate an internal traceback whenever it's constructed.
With that said i haven't ever done the above - anyone done something similar? Or approached this a different way?
- bb88 4y agoGiven enough digging around in the python runtime system I'm sure you can find the current stack trace and shove that in an error class. But now it's a lesser error than an exception. Any exception while processing your error will cause the stack to unwind and drop the error variable with the stack trace inside of it. Now if you raise an exception while in the handling of an exception, python will keep around both stack traces.