diff --git a/src/Communication/Connection.php b/src/Communication/Connection.php index de97c87..d7bc727 100644 --- a/src/Communication/Connection.php +++ b/src/Communication/Connection.php @@ -376,10 +376,10 @@ private function dispatchMessage(string $message, ?Session $session = null) $response = \json_decode($message, true); // if json not valid throw exception - $jsonError = \json_last_error(); - if (\JSON_ERROR_NONE !== $jsonError) { + $jsonErrorId = \json_last_error(); + if (\JSON_ERROR_NONE !== $jsonErrorId) { if ($this->isStrict()) { - throw new CannotReadResponse(\sprintf('Response from chrome remote interface is not a valid json response. JSON error: %s', $jsonError)); + throw new CannotReadResponse(\sprintf('Response from chrome remote interface is not a valid json response. JSON error: %d: %s', $jsonErrorId, \json_last_error_msg())); } return false;