Skip to content

Commit

Permalink
settings: get error response from webservice_exception
Browse files Browse the repository at this point in the history
  • Loading branch information
jrchamp authored Jul 31, 2023
1 parent 3a82c21 commit daae510
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit daae510

Please sign in to comment.