Skip to content

Commit

Permalink
Merge pull request ncstate-delta#503 from ncstate-delta/fix/zoom-erro…
Browse files Browse the repository at this point in the history
…r-message-handling

settings: get error response from webservice_exception
  • Loading branch information
jrchamp authored Aug 3, 2023
2 parents e66f829 + d5e5441 commit cb97951
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 cb97951

Please sign in to comment.