diff --git a/src/Oauth2/Client/Client.php b/src/Oauth2/Client/Client.php index bb91eb29..9b4ea2e3 100755 --- a/src/Oauth2/Client/Client.php +++ b/src/Oauth2/Client/Client.php @@ -25,7 +25,17 @@ class Provider { $name = ucfirst(strtolower($name)); - require_once 'Provider/'.$name.'.php'; + $fileName = 'Provider/'.$name.'.php'; + + if (file_exists($fileName)) { + + require_once $fileName; + + } else { + + throw new Exception('There is no provider configuration file for '.$name); + + } return new $name($options); }