Skip to content

Commit aa654a3

Browse files
committed
[BUGFIX] Fixed exception-handler rewrite not always triggered
1 parent 8c79b74 commit aa654a3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Pecee/SimpleRouter/Router.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ public function start(): ?string
346346
/* Verify csrf token for request */
347347
$this->csrfVerifier->handle($this->request);
348348
} catch(Exception $e) {
349-
$this->handleException($e);
349+
return $this->handleException($e);
350350
}
351351
}
352352

@@ -444,12 +444,12 @@ public function routeRequest(): ?string
444444
}
445445

446446
} catch (Exception $e) {
447-
$this->handleException($e);
447+
return $this->handleException($e);
448448
}
449449

450450
if ($methodNotAllowed === true) {
451451
$message = sprintf('Route "%s" or method "%s" not allowed.', $this->request->getUrl()->getPath(), $this->request->getMethod());
452-
$this->handleException(new NotFoundHttpException($message, 403));
452+
return $this->handleException(new NotFoundHttpException($message, 403));
453453
}
454454

455455
if (count($this->request->getLoadedRoutes()) === 0) {

0 commit comments

Comments
 (0)