Closed ghost closed 8 years ago
Added more details.
Does this fix anything? It seems you're just adding a new condition to check for a possible problem and throw another unnecessary exception
The code already throws exception because it encountered a problem, so there's no need for another exception to make things more bloated, what it need is a fix to make sure that this exception will not complain again.
Its needed there since without it on my 2 accounts today i got error:
Fatal error: Uncaught exception 'Exception' with message 'Incorrect wire format for field 7, expected: 2 got: 4' in the ResponseEnvelope.php file
after some checking i found that niantic servers returns 403 for me.
Just api got html page with 403 error as response and is trying to parse it.
Why do you consider throwing an Exception "unnecessary". It is way better than continuing with an invalid response and running into a weird ("wire format") error that has no clue about the original problem.
The only thing that could be better is throwing a more specific Exception than "Exception", so you can catch more specifically. Or just turn Guzzle exceptions back on (I don't really see a reason why they are disabled).
Can be related with #85, got same error today, after digging -> server returns 403