Skip to content

Commit 759d92f

Browse files
committed
Catch all Throwables in api-consumers and wrap them in an Exception
1 parent ba63193 commit 759d92f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/de/bluecolored/bluemap/api/BlueMapAPI.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ private static boolean callConsumers(BlueMapAPI instance, List<Consumer<BlueMapA
235235
for (Consumer<BlueMapAPI> consumer : consumers) {
236236
try {
237237
consumer.accept(instance);
238-
} catch (Exception ex) {
239-
thrownExceptions.add(ex);
238+
} catch (Throwable t) {
239+
thrownExceptions.add(new Exception("Unexpected exception trying to call an API consumer", t));
240240
}
241241
}
242242
return throwAsOne(thrownExceptions);

0 commit comments

Comments
 (0)