Skip to content

Commit

Permalink
[Fix] Fixed broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eitch committed Jul 9, 2024
1 parent 802bf7d commit 15a12a1
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ public void lockedExecute(T element, CheckedRunnable action) {
try {
action.run();
} catch (Exception e) {
if (e instanceof RuntimeException re)
throw re;
String msg = format("Failed to execute action {0} for locked element {1}", action, element);
throw new ElementLockingException(msg, e);
throw new IllegalStateException(msg, e);
} finally {
unlock(element);
}
Expand All @@ -75,6 +77,8 @@ public <U> U lockedExecuteWithResult(T element, CheckedSupplier<U> action) {
try {
return action.get();
} catch (Exception e) {
if (e instanceof RuntimeException re)
throw re;
String msg = format("Failed to execute action {0} for locked element {1}", action, element);
throw new IllegalStateException(msg, e);
} finally {
Expand Down

0 comments on commit 15a12a1

Please sign in to comment.