From 1d40958b427c731a5125995f459248cd10c4abe8 Mon Sep 17 00:00:00 2001 From: AndyChen Date: Thu, 14 Sep 2023 19:52:14 +0800 Subject: [PATCH] fix: rethrow exception on failure --- .../persistence/jdbc/journal/JdbcAsyncWriteJournal.scala | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/src/main/scala/akka/persistence/jdbc/journal/JdbcAsyncWriteJournal.scala b/core/src/main/scala/akka/persistence/jdbc/journal/JdbcAsyncWriteJournal.scala index ad4089fb2..08a6886a7 100644 --- a/core/src/main/scala/akka/persistence/jdbc/journal/JdbcAsyncWriteJournal.scala +++ b/core/src/main/scala/akka/persistence/jdbc/journal/JdbcAsyncWriteJournal.scala @@ -118,9 +118,10 @@ class JdbcAsyncWriteJournal(config: Config) extends AsyncWriteJournal { journalDao .messagesWithBatch(persistenceId, fromSequenceNr, toSequenceNr, journalConfig.daoConfig.replayBatchSize, None) .take(max) - .collect { case Success(reprAndOrdNr) => reprAndOrdNr } - .runForeach { case (repr, _) => - recoveryCallback(repr) + .runForeach { + case Success((repr, _)) => + recoveryCallback(repr) + case Failure(ex) => throw ex } .map(_ => ())