Open DominicOram opened 6 days ago
Rather than exception_type
I would prefer we either make reason
"str or object" (in json language) or make the new field an "object" so we can grow it and/or customize it locally without having to make changes upstream.
The string reason is something we threw in early as as "this seems useful for post-mortem" but to my knowledge have actually done little with it.
Until very recently the keys in RunStop
were not locked down (I think we locked it down as part of the cleanup @evalott100 did in 2023), another escape hatch is to re-relax that (but my guess is that there is not a lot of enthusiasm for it).
At DLS MX we have a callback that where we want to do different things based on how the plan failed.
Currently, when an exception occurs in a plan the string representation of the error gets put into the
reason
field of theRunStop
. Usually, the string representation is the human readable description of the error and so is useful for reporting to a user but hard to guarantee that it can be cleanly inspected to give a machine-readable error type.If we added an extra optional field to the
RunStop
of something likeexception_type
that gave the class of the exception we could use this to determine what to do in the callback. This would involve:RunStop
close_run
str(type(err))
There is currently a
data_type
in theRunStop
. As far as I can tell this doesn't seem to be used I guess we could re-appropriate that but it seems messy.