Sometimes you need additional context on the error, for example when erroring out because a spawned process fails, the error code or kill signal could be useful.
Also, when handling the error, it's often useful to know what the program was doing. For example in an IOError, knowing the file path that caused the error can be very useful. I was long thinking this kind of information is really mapping the stack frames. It's kind of stack frame context metadata for the errors. Could it be possible to have thread-local or stack-local variables where such context could be added in case of an error. That would make perfectly sense to me. Like a thread-local `errno` where it's possible to add string data.