Open vchuravy opened 2 years ago
Excellent point Valentin. It seems like the ExceptionStack
object itself isn't enough, since we probably want to have something that still <: Exception
, so that it can e.g. be used to close(::Channel, ::Exception)
.
Would one of these two options make sense?:
CapturedException
, which captures an entire catch stack? Like:
struct CapturedExceptionStackException <: Exception
catch_stack::Vector{Any}
end
CapturedException
implementation to hold a catch stack instead of the current exception + backtrace?
Maybe the name for the first one could be CapturedCatchStack <: Exception
? Or CapturedExceptionStack <: Exception
?
On the other hand, ideally the fields of a struct like this really shouldn't be part of the API of the stdlib. It shouldn't be a breaking change to change them, as long as we keep the existing method behaviors the same.. :/ But i know that this isn't the reality of how things work since julia doesn't have any encapsulation or private/public. :/
Do you have a preference here, @vchuravy?
Could we potentially make use of the exception stack here now?
_Originally posted by @vtjnash in https://github.com/JuliaLang/julia/pull/42105#discussion_r780423800_