mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 21:12:14 +00:00
Merge pull request #661 from skipperbent/v5-development
Reverted exception handling to old behavior (issue: #660)
This commit is contained in:
@@ -443,14 +443,10 @@ class Router
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (\Throwable $e) {
|
} catch (Exception $e) {
|
||||||
if ($e instanceof Exception) {
|
|
||||||
return $this->handleException($e);
|
return $this->handleException($e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->handleException(new Exception($e->getMessage(), $e->getCode()));
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($methodNotAllowed === true) {
|
if ($methodNotAllowed === true) {
|
||||||
$message = sprintf('Route "%s" or method "%s" not allowed.', $this->request->getUrl()->getPath(), $this->request->getMethod());
|
$message = sprintf('Route "%s" or method "%s" not allowed.', $this->request->getUrl()->getPath(), $this->request->getMethod());
|
||||||
return $this->handleException(new NotFoundHttpException($message, 403));
|
return $this->handleException(new NotFoundHttpException($message, 403));
|
||||||
|
|||||||
Reference in New Issue
Block a user