JeffersonLab / JANA2

Multi-threaded HENP Event Reconstruction
https://jeffersonlab.github.io/JANA2/
Other
6 stars 9 forks source link

JPluginLoader doesn't report caught exceptions #274

Closed veprbl closed 5 months ago

veprbl commented 7 months ago

Reproducer via a test change to EICrecon:

diff --git a/src/detectors/BTRK/BTRK.cc b/src/detectors/BTRK/BTRK.cc
--- a/src/detectors/BTRK/BTRK.cc
+++ b/src/detectors/BTRK/BTRK.cc
@@ -15,6 +15,7 @@
 extern "C" {
 void InitPlugin(JApplication *app) {
     InitJANAPlugin(app);
+    throw std::runtime_error("this is a test");

     using namespace eicrecon;

Results in

[WARN] JPluginLoader: Loading failure: [ERROR] JPluginLoader: Couldn't load plugin 'BTRK'

...

    ./BTRK.so  =>  File not found
    prefix/lib/EICrecon/plugins/BTRK.so  =>  Loading failure: 
----------------------------------------------------------
Exception: Couldn't find plugin 'BTRK'

We like that it loudly fails, but it could use a wording like "Unhandled exception in InitPlugin" to help guide users on the right path.

veprbl commented 5 months ago

https://github.com/JeffersonLab/JANA2/issues/291