From 7c5137b02a07eef4e515bdf261a9c242117d158d Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Mon, 6 Oct 2014 22:42:34 -0400 Subject: [PATCH] Type hint correct exception --- src/AdamWathan/EloquentOAuth/Providers/Provider.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/AdamWathan/EloquentOAuth/Providers/Provider.php b/src/AdamWathan/EloquentOAuth/Providers/Provider.php index 230d9e8..143e4ed 100644 --- a/src/AdamWathan/EloquentOAuth/Providers/Provider.php +++ b/src/AdamWathan/EloquentOAuth/Providers/Provider.php @@ -5,6 +5,7 @@ use AdamWathan\EloquentOAuth\Exceptions\InvalidAuthorizationCodeException; use Illuminate\Http\Request as Input; use Guzzle\Http\Client as HttpClient; +use Guzzle\Http\Exception\BadResponseException; abstract class Provider implements ProviderInterface { @@ -92,7 +93,7 @@ protected function requestAccessToken() $request = $this->httpClient->post($url, $this->headers['access_token'], $this->buildAccessTokenPostBody()); try { $response = $request->send(); - } catch (\Exception $e) { + } catch (BadResponseException $e) { throw new InvalidAuthorizationCodeException((string) $e->getResponse()); } return $this->parseTokenResponse((string) $response->getBody());