Skip to content

Commit

Permalink
fix EventStoreConnectionLogicHandler on closed connection
Browse files Browse the repository at this point in the history
  • Loading branch information
prolic committed Jun 14, 2024
1 parent 4d88dbb commit 3937da5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Internal/EventStoreConnectionLogicHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace Prooph\EventStoreClient\Internal;

use Amp\ByteStream\ClosedException;
use Amp\DeferredFuture;
use Closure;
use Exception;
Expand Down Expand Up @@ -174,7 +175,8 @@ function (TcpConnectionErrorMessage $message): void {
function (TcpConnectionClosedMessage $message): void {
$this->tcpConnectionClosed($message->tcpPackageConnection());

if ($message->exception()) {
// if connection was closed, don't throw that exception, we do retry instead
if ($message->exception() && ! $message->exception() instanceof ClosedException) {
throw $message->exception();
}
}
Expand Down

0 comments on commit 3937da5

Please sign in to comment.