I test $oauth->getAccessToken() method in this section: https://github.com/basvandorst/StravaPHP#usage-1
When I call it first time with some token, everything is OK, I retrieve the following response:
But when I call it second time, I get an InvalidArgumentException:
I understand why this happens - there is no "access_token" in response, 'cause response looks like that:
But at first it was not obvious to me. Is it possible to handle this? I mean, is it possible to throw another exception, more clear, about exactly invalid authorization code; some exception, that clearly tells us, that we can't use same auth code twice? Then it would be easier to handle this more specific exception.
I test
$oauth->getAccessToken()
method in this section: https://github.com/basvandorst/StravaPHP#usage-1 When I call it first time with some token, everything is OK, I retrieve the following response:But when I call it second time, I get an
InvalidArgumentException
:I understand why this happens - there is no "access_token" in response, 'cause response looks like that:
But at first it was not obvious to me. Is it possible to handle this? I mean, is it possible to throw another exception, more clear, about exactly invalid authorization code; some exception, that clearly tells us, that we can't use same auth code twice? Then it would be easier to handle this more specific exception.
Thanks.