Skip to content
This repository was archived by the owner on Oct 30, 2024. It is now read-only.

Commit 97b2d6b

Browse files
committed
Fix bug non getting Exception on failed auth
1 parent 8f74de2 commit 97b2d6b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Nats/Connection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public function getStreamSocket()
187187
*/
188188
private function isErrorResponse($response)
189189
{
190-
return false !== strpos('-ERR', $response);
190+
return substr( $response, 0, 4 ) === "-ERR";
191191
}
192192

193193

@@ -388,6 +388,7 @@ public function connect($timeout = null)
388388

389389
$msg = 'CONNECT '.$this->options;
390390
$this->send($msg);
391+
$infoResponse = $this->receive();
391392
$connectResponse = $this->receive();
392393

393394
if ($this->isErrorResponse($connectResponse) === true) {

0 commit comments

Comments
 (0)