Skip to content

Commit a5993b3

Browse files
committed
ModuleRunner: do not rethrow caught exceptions
Apparently this is a bad practice. Better to use chaining.
1 parent b3fcd90 commit a5993b3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/main/java/org/scijava/module/ModuleRunner.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,10 @@ public Module call() {
124124
run();
125125
}
126126
catch (final RuntimeException exc) {
127-
if (log != null) log.error("Module threw exception", exc);
128-
throw exc;
127+
throw new RuntimeException("Module threw exception", exc);
129128
}
130129
catch (final Error err) {
131-
if (log != null) log.error("Module threw error", err);
132-
throw err;
130+
throw new RuntimeException("Module threw error", err);
133131
}
134132
return module;
135133
}

0 commit comments

Comments
 (0)