Closed davereid closed 2 years ago
Thanks for the contribution @davereid! I'm not opposed to adding this, but it's worth mentioning that I pass the original exception through, so you can access that message today like $e->getPrevious()->getMessage()
.
If the access token response returns like a 401 error, it would be good to include the exception message from Guzzle back into the AccessTokenRequestException. For example, I wrote a custom GrantType that throws a custom BadResponseException (since our API returns its error messages inside the body of the response), but with this current code, that exception message is lost and only reported as "Unable to request a new access token" which isn't the most helpful in knowing why that request failed.