Closed DraTeots closed 5 months ago
We hang onto the std::current_exception pointer everywhere else in JANA. I'll modify JOmniFactory to store it there as well. I'm just not sure that it does any good in practice. This is because you'd have to rethrow the stored exception in order to unpack whatever it contains (apart from e.what()
)
I personally can't stand how C++ does exceptions at all, compared to literally any other programming language in widespread use. I think Cling actually makes them a lot better, and our JException and JBacktrace is a weak approximation of that. If you have any flashes of inspiration as to how you'd improve JExceptions, feel free to share
As I recall use of JExceptions benefits include better reporting and handling inside JANA2. So it is recommended to use JException and base your own classes on JExpection when working with JANA2. The problem arizes for stubs like this (taken from OmniFactory):
The type of underlying exception sometimes might be the same or more important as e.what() but it gets stripped. I would propose adding something like
With the corresponding reporting