Skip to content

Commit

Permalink
removes unnecessary exception handling code.
Browse files Browse the repository at this point in the history
we don't need to catch anything here, the exception is never thrown.
  • Loading branch information
stopfstedt committed Oct 12, 2024
1 parent b0af9bd commit d928153
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 d928153

Please sign in to comment.