From daae510b005c435eaec7d267fba4ff069f284d49 Mon Sep 17 00:00:00 2001 From: Jonathan Champ Date: Mon, 31 Jul 2023 01:10:53 -0400 Subject: [PATCH] settings: get error response from webservice_exception --- settings.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/settings.php b/settings.php index 502cca91..872b3c15 100644 --- a/settings.php +++ b/settings.php @@ -36,14 +36,16 @@ // Test whether connection works and display result to user. if (!CLI_SCRIPT && $PAGE->url == $CFG->wwwroot . '/' . $CFG->admin . '/settings.php?section=modsettingzoom') { - $status = 'connectionok'; - $notifyclass = 'notifysuccess'; + $status = 'connectionfailed'; + $notifyclass = 'notifyproblem'; $errormessage = ''; try { zoom_get_user(zoom_get_api_identifier($USER)); + $status = 'connectionok'; + $notifyclass = 'notifysuccess'; + } catch (\mod_zoom\webservice_exception $error) { + $errormessage = $error->response; } catch (moodle_exception $error) { - $notifyclass = 'notifyproblem'; - $status = 'connectionfailed'; $errormessage = $error->a; }