ilovepdf / ilovepdf-php

iLovePDF Rest Api - PHP Library (https://developer.ilovepdf.com)
146 stars 39 forks source link

429 response throwing `Undefined property: stdClass::$error` #32

Closed rhys-steele closed 2 years ago

rhys-steele commented 3 years ago

When the rate limit is hit and the server responds with a 429 the error handling on line Ilovepdf.php@208 is throwing an Undefined property: stdClass::$error because $response->body->error is not set.

This could be happening on other error response codes but I have been unable to test.

Image of debug output

--

https://github.com/ilovepdf/ilovepdf-php/blob/5d9a51d608ef639607e076ce22381f7bad83e5d8/src/Ilovepdf.php#L208