From 0e6ee5e9e2cbc74acb4c295f8c5762851eb385a0 Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Fri, 6 Sep 2013 10:46:17 +0800 Subject: [PATCH] MDL-41630 oauth: Throw exception instead of dying on error --- lib/oauthlib.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/oauthlib.php b/lib/oauthlib.php index 6fc448312ea..afc92643379 100644 --- a/lib/oauthlib.php +++ b/lib/oauthlib.php @@ -228,9 +228,7 @@ class oauth_helper { // oauth_token_secret $result = $this->parse_result($content); if (empty($result['oauth_token'])) { - // failed - var_dump($result); - exit; + throw new moodle_exception('Error while requesting an oauth token'); } // build oauth authrize url if (!empty($this->oauth_callback)) {