diff --git a/ajax.php b/ajax.php index 170d72d..3917442 100644 --- a/ajax.php +++ b/ajax.php @@ -66,12 +66,7 @@ $outcome->response = new stdClass(); $outcome->error = ''; -try { - $ilios = di::get(ilios::class); -} catch (Exception $e) { - // Re-throw exception. - throw new Exception('ERROR: Failed to instantiate Ilios client.', $e); -} +$ilios = di::get(ilios::class); switch ($action) { case 'getselectschooloptions': diff --git a/edit.php b/edit.php index e3d580d..5cc1d1e 100644 --- a/edit.php +++ b/edit.php @@ -48,12 +48,7 @@ redirect($returnurl); } -try { - $ilios = di::get(ilios::class); -} catch (Exception $e) { - // Re-throw exception. - throw new Exception('ERROR: Failed to instantiate Ilios client.', $e); -} +$ilios = di::get(ilios::class); /** @var enrol_ilios_plugin $enrol */ $enrol = enrol_get_plugin('ilios'); diff --git a/lib.php b/lib.php index 4a54851..c22b067 100644 --- a/lib.php +++ b/lib.php @@ -45,12 +45,7 @@ class enrol_ilios_plugin extends enrol_plugin { * Constructor. */ public function __construct() { - try { - $this->ilios = di::get(ilios::class); - } catch (Exception $e) { - // Re-throw exception. - throw new Exception('ERROR: Failed to instantiate Ilios client.', $e); - } + $this->ilios = di::get(ilios::class); } /**