Closed bmcfee closed 9 months ago
I have definitely run into this too.
Yeah, I think that should be doable, and desirable. I've been doing things somewhat like this with scripts when I run them in docker / AWS ECS, because I always want to know exactly where the script failed, since all I have is the log to go by. python is pretty good for this sort of behavior.
Circling back: this could be much cleaner after we drop 2.7 #149 so that we can use the raise from ...
syntax for exception chaining.
Yessssssssssssssss
Pescador sometimes makes it tricky to debug systems. As a recent example, we had a setup where some streamers in a mux were failing due to a data error, which crashed the whole system, but it was not easy to determine which streamer caused the exception.
Here's how the stack looked:
As you can see, at the last three levels of the stack (
pesc->custom code->pumpp
), it shows the header of the Streamer function that caused the error:data_sampler_2(fname, ...)
, but it does not show the values of the parameters into the function. If you have a mux that fans out a grid of parameters over a common function -- a pretty typical use pattern -- then this information is basically useless for debugging.This got me thinking: would it be possible for streamers to add metadata to the exception stack? That is, intercept the exception, modify the message, and re-raise it so that the parameters of the streamer are made explicit? Anyone care to look into the proper way to do this sort of thing?