Skip to content

Commit

Permalink
SingleWriterService > Handle all exceptions that can be thrown durin…
Browse files Browse the repository at this point in the history
…g the task execution.

This allows all futures to finish and issues being visible.
  • Loading branch information
A-Imal committed Dec 12, 2023
1 parent e56af0f commit d8d67b6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public InMemoryProducerQueues(final int persistenceBucketCount, final int amount
} else {
successCallback.afterTask(result);
}
} catch (final Exception e) {
} catch (final Throwable e) {
if (resultFuture != null) {
resultFuture.setException(e);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public void execute(final @NotNull SplittableRandom random) {
.afterTask(result));
}
}
} catch (final Exception e) {
} catch (final Throwable e) {
if (taskWithFuture.getFuture() != null) {
taskWithFuture.getFuture().setException(e);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ interface SuccessCallback<R> {
}

interface FailedCallback {
void afterTask(@NotNull Exception exception);
void afterTask(@NotNull Throwable exception);
}
}

0 comments on commit d8d67b6

Please sign in to comment.