Skip to content

Commit

Permalink
CHanged exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandraLivadas committed Jul 8, 2020
1 parent 9cb22fc commit 9ed7db6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modules/electrophysiology_browser/php/sessions.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ class Sessions extends \NDB_Page
* @param \User $user The user to load the resources for
* @param ServerRequestInterface $request The PSR15 Request being handled
*
* @throws \LorisException If the session is non-numerical or does not exist
* @throws \DomainException If the session id is non-numerical
* @throws \LorisException If the session is not found
*
* @return void
*/
Expand All @@ -72,7 +73,7 @@ class Sessions extends \NDB_Page
$matches = [];

if (preg_match('#/sessions/(\d+)#', $path, $matches) !== 1) {
throw new \LorisException("Invalid session");
throw new \DomainException("Invalid session");
}
$session_id = intval($matches[1]);
try {
Expand All @@ -81,7 +82,7 @@ class Sessions extends \NDB_Page
);
$this->sessionID = $session_id;
} catch(\LorisException $e) {
throw new \LorisException("Session not found");
throw $e;
}

$candID = $this->timepoint->getCandID();
Expand Down

0 comments on commit 9ed7db6

Please sign in to comment.