[Minor] Don't catch RuntimeException in ElementLockingHandler.lockedExecute*

This commit is contained in:
Robert von Burg 2023-04-05 15:17:33 +02:00
parent 8002d32121
commit 10f201ad9d
Signed by: eitch
GPG Key ID: 75DB9C85C74331F7
1 changed files with 6 additions and 0 deletions

View File

@ -51,6 +51,9 @@ public class ElementLockingHandler<T> {
lock(element);
try {
action.run();
} catch (RuntimeException e) {
logger.error("Failed to execute action " + action + " for locked element " + element, e);
throw e;
} catch (Exception e) {
throw new IllegalStateException("Failed to execute action " + action + " for locked element " + element, e);
} finally {
@ -76,6 +79,9 @@ public class ElementLockingHandler<T> {
lock(element);
try {
return action.get();
} catch (RuntimeException e) {
logger.error("Failed to execute action " + action + " for locked element " + element, e);
throw e;
} catch (Exception e) {
throw new IllegalStateException("Failed to execute action " + action + " for locked element " + element, e);
} finally {