Skip to content

Commit

Permalink
Missing route error
Browse files Browse the repository at this point in the history
  • Loading branch information
svandragt committed Aug 23, 2020
1 parent bf374f3 commit b15940b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ protected function classNotCallable($controller_class): void
{
$Url = new Url('/errors/404');
$log_message = "Not callable '$controller_class' or missing parameter.";
if (empty($controller_class)) {
$log_message = "Missing route";
}
$this->redirect($Url, $log_message);
}

Expand All @@ -85,7 +88,7 @@ protected function classNotCallable($controller_class): void
*/
protected function redirect($Url, string $log_message): void
{
echo( "Location: " . $Url->url_absolute );
echo( "Location: " . $Url->url_absolute . PHP_EOL );
exit($log_message);
}
}

0 comments on commit b15940b

Please sign in to comment.