From a5993b3a9cd9c634881b4c30c47ac95884ff451d Mon Sep 17 00:00:00 2001 From: Curtis Rueden Date: Wed, 5 Aug 2020 11:38:16 -0500 Subject: [PATCH] ModuleRunner: do not rethrow caught exceptions Apparently this is a bad practice. Better to use chaining. --- src/main/java/org/scijava/module/ModuleRunner.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/scijava/module/ModuleRunner.java b/src/main/java/org/scijava/module/ModuleRunner.java index d514afa54..b8ec3a20a 100644 --- a/src/main/java/org/scijava/module/ModuleRunner.java +++ b/src/main/java/org/scijava/module/ModuleRunner.java @@ -124,12 +124,10 @@ public Module call() { run(); } catch (final RuntimeException exc) { - if (log != null) log.error("Module threw exception", exc); - throw exc; + throw new RuntimeException("Module threw exception", exc); } catch (final Error err) { - if (log != null) log.error("Module threw error", err); - throw err; + throw new RuntimeException("Module threw error", err); } return module; }