Open isbkch opened 8 years ago
@isbkch what version of Laravel are you using? Thanks!
I'm using 5.2 It turned out this error was thrown when Lookup desn't find any results. It works just fine when I have results :)
Thanks for letting me know @isbkch I'll try get a fix in for that as soon as possible.
Same problem here!.. Also l5.2 Anything new on the matter?
Thanks! :)
Will be taking a look at it this weekend, thanks for your patience.
Hi, any updates on this issue? thanks. :)
No updates yet, still not found the time to sit down and work through this. If anyone does have time, feel free to submit a PR for review.
I've run into this same issue ... sometimes (like when amazon returns 400 "bad request" or a 503 "rate limit" response) a Guzzle/PSR7/Response object is returned by the Amazon::search(), which does not have a json() method. In this case you must call something like $response->getReasonPhrase() or $response->getStatusCode() to detect and return some sort of error message to the user.
What is odd is that the AmazonECS object is somehow being replaced by the Guzzle Response object within the facade when the search() method returns.
@JoeDawson I get the same issue as @brino & @leinad952003 -- Has anyone found a solution for this?
Resolved by updating AmazonECS.php
Lines 64 & 85..
Change: ClientException To: ClientErrorResponseException
Doing a simple:
$bookFromAmazon = Amazon::lookup($bookTitle)->json();
throws an error:Call to undefined method GuzzleHttp\Psr7\Response::json()
do you have any idea why ?PS:
->xml()
gives the same error