diff options
Diffstat (limited to 'src/Router/Router.php')
-rw-r--r-- | src/Router/Router.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Router/Router.php b/src/Router/Router.php index b167142..1739e7c 100644 --- a/src/Router/Router.php +++ b/src/Router/Router.php @@ -67,7 +67,11 @@ class Router } catch (MethodNotAllowedException $exception) { return new ErrorResponse(ErrorCode::FORBIDDEN, "403", Response::HTTP_FORBIDDEN); } catch (\Exception $exception) { - return new ErrorResponse(ErrorCode::UNKNOWN, "Unknown error occured", Response::HTTP_INTERNAL_SERVER_ERROR); + return new ErrorResponse( + ErrorCode::UNKNOWN, + $exception->getMessage() ?: "Unknown error occured", + Response::HTTP_INTERNAL_SERVER_ERROR + ); } } |