diff --git a/src/Bolt/BoltConnection.php b/src/Bolt/BoltConnection.php index 7255b6c5..93f3b3fa 100644 --- a/src/Bolt/BoltConnection.php +++ b/src/Bolt/BoltConnection.php @@ -30,6 +30,7 @@ use Laudis\Neo4j\Contracts\FormatterInterface; use Laudis\Neo4j\Databags\BookmarkHolder; use Laudis\Neo4j\Databags\DatabaseInfo; +use Laudis\Neo4j\Databags\Neo4jError; use Laudis\Neo4j\Enum\AccessMode; use Laudis\Neo4j\Enum\ConnectionProtocol; use Laudis\Neo4j\Exception\Neo4jException; @@ -402,7 +403,11 @@ private function assertNoFailure(Response $response): void { if ($response->signature === Signature::FAILURE) { $this->logger?->log(LogLevel::ERROR, 'FAILURE'); - $this->protocol()->reset()->getResponse(); // what if the reset fails? what should be expected behaviour? + $resetResponse = $this->protocol()->reset()->getResponse(); + $this->subscribedResults = []; + if ($resetResponse->signature === Signature::FAILURE) { + throw new Neo4jException([Neo4jError::fromBoltResponse($resetResponse), Neo4jError::fromBoltResponse($response)]); + } throw Neo4jException::fromBoltResponse($response); } }