aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2022-07-11 13:30:28 +0300
committerEvgeny Zinoviev <me@ch1p.io>2022-07-11 13:30:28 +0300
commit659b96f43c700c9c5099b12fe951babcc38a1f31 (patch)
treea5eaa43d33a17cbafc3ec55b34dbd7613b0778c3 /engine
parente1ada2fe3910f37f17b5b68c3998e4d5ee3bf0d9 (diff)
RequestDispatcher: show handler-not-found message only in dev mode
Diffstat (limited to 'engine')
-rw-r--r--engine/RequestDispatcher.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/engine/RequestDispatcher.php b/engine/RequestDispatcher.php
index ec31516..adb61c9 100644
--- a/engine/RequestDispatcher.php
+++ b/engine/RequestDispatcher.php
@@ -7,6 +7,8 @@ class RequestDispatcher {
) {}
public function dispatch(): void {
+ global $config;
+
try {
if (!in_array($_SERVER['REQUEST_METHOD'], ['POST', 'GET']))
throw new NotImplementedException('Method '.$_SERVER['REQUEST_METHOD'].' not implemented');
@@ -27,7 +29,7 @@ class RequestDispatcher {
$handler_class = 'handler\\'.$handler_class;
if (!class_exists($handler_class))
- throw new NotFoundException('Handler class "'.$handler_class.'" not found');
+ throw new NotFoundException($config['is_dev'] ? 'Handler class "'.$handler_class.'" not found' : '');
$router_input = [];
if (count($route) > 1) {