From a00d3d1dd1293db5e97478aa4664a03172ef1905 Mon Sep 17 00:00:00 2001 From: hepisec Date: Mon, 31 May 2021 11:34:16 +0200 Subject: [PATCH] Update PlentymarketsRestClient.php Fixed bug in exception handler --- src/PlentymarketsRestClient/PlentymarketsRestClient.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PlentymarketsRestClient/PlentymarketsRestClient.php b/src/PlentymarketsRestClient/PlentymarketsRestClient.php index 5e7dd24..084baee 100644 --- a/src/PlentymarketsRestClient/PlentymarketsRestClient.php +++ b/src/PlentymarketsRestClient/PlentymarketsRestClient.php @@ -91,7 +91,7 @@ public function singleCall($method, $path, $params = []) } catch (\Exception $e) { // For a better Plentymarkets exception handling. Sometimes the limit is not correct - if (s($e->getMessage())->contains(self::ERROR_SHORT_PERIOD_READ_LIMIT)) { + if (new (s($e->getMessage()))->contains(self::ERROR_SHORT_PERIOD_READ_LIMIT)) { sleep(self::WAIT_ERROR_SHORT_PERIOD_READ_LIMIT); $this->singleCall($method, $path, $params); // TODO possible handle recursion errors