Skip to content

Commit

Permalink
Merge pull request #61 from stopfstedt/rm_unnecessary_exception_handling
Browse files Browse the repository at this point in the history
removes unnecessary exception handling code.
  • Loading branch information
jrjohnson authored Oct 14, 2024
2 parents b0af9bd + d928153 commit 09b446e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
7 changes: 1 addition & 6 deletions ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
7 changes: 1 addition & 6 deletions edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
7 changes: 1 addition & 6 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 09b446e

Please sign in to comment.