RequestDispatcher: show handler-not-found message only in dev mode
This commit is contained in:
parent
e1ada2fe39
commit
659b96f43c
@ -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) {
|
||||
|
@ -29,10 +29,10 @@ return <<<HTML
|
||||
<head><title>$code $title</title></head>
|
||||
<body>
|
||||
<center><h1>$code $title</h1></center>
|
||||
<hr>
|
||||
{$ctx->if_true($message,
|
||||
'<hr><p align="center">'.$message.'</p>'
|
||||
'<p align="center">'.$message.'</p>'
|
||||
)}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
HTML;
|
||||
|
Loading…
x
Reference in New Issue
Block a user