From f34e05f6b280accb651ee9a734c16ad1e316ffe8 Mon Sep 17 00:00:00 2001 From: Nathan Brei Date: Thu, 2 May 2024 00:15:54 -0400 Subject: [PATCH] Better exception handling in JEventUnfolder --- src/libraries/JANA/JEventUnfolder.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/libraries/JANA/JEventUnfolder.h b/src/libraries/JANA/JEventUnfolder.h index bd877e915..73882b1d6 100644 --- a/src/libraries/JANA/JEventUnfolder.h +++ b/src/libraries/JANA/JEventUnfolder.h @@ -115,6 +115,13 @@ class JEventUnfolder : public jana::omni::JComponent, } throw ex; } + catch (std::exception& e) { + auto ex = JException("Exception in JEventUnfolder::DoPreprocess(): %s", e.what()); + ex.nested_exception = std::current_exception(); + ex.plugin_name = m_plugin_name; + ex.component_name = m_type_name; + throw ex; + } catch (...) { auto ex = JException("Unknown exception in JEventUnfolder::DoPreprocess()"); ex.nested_exception = std::current_exception(); @@ -182,6 +189,13 @@ class JEventUnfolder : public jana::omni::JComponent, } throw ex; } + catch (std::exception& e) { + auto ex = JException("Exception in JEventUnfolder::DoUnfold(): %s", e.what()); + ex.nested_exception = std::current_exception(); + ex.plugin_name = m_plugin_name; + ex.component_name = m_type_name; + throw ex; + } catch (...) { auto ex = JException("Exception in JEventUnfolder::DoUnfold()"); ex.nested_exception = std::current_exception();