Skip to content

Commit 7254372

Browse files
improved handle of failure
1 parent bf836b2 commit 7254372

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Bolt/BoltConnection.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,11 @@ public function getUserAgent(): string
372372
private function assertNoFailure(Response $response): void
373373
{
374374
if ($response->signature === Signature::FAILURE) {
375-
$this->protocol()->reset()->getResponse(); //what if the reset fails? what should be expected behaviour?
375+
$resetResponse = $this->protocol()->reset()->getResponse();
376+
$this->subscribedResults = [];
377+
if ($resetResponse->signature === Signature::FAILURE) {
378+
throw new Neo4jException([Neo4jError::fromBoltResponse($resetResponse), Neo4jError::fromBoltResponse($response)]);
379+
}
376380
throw Neo4jException::fromBoltResponse($response);
377381
}
378382
}

0 commit comments

Comments
 (0)