diff --git a/Herbert/Framework/Router.php b/Herbert/Framework/Router.php index bb43ed3..5b41a07 100644 --- a/Herbert/Framework/Router.php +++ b/Herbert/Framework/Router.php @@ -248,15 +248,25 @@ public function parseRequest($wp) die; } - global $wp_query; - $wp_query->set_404(); + if ($e->getStatus() === 404) + { + global $wp_query; + $wp_query->set_404(); + } status_header($e->getStatus()); define('HERBERT_HTTP_ERROR_CODE', $e->getStatus()); define('HERBERT_HTTP_ERROR_MESSAGE', $e->getMessage()); - @include get_404_template(); + if ($e->getStatus() === 404) + { + @include get_404_template(); + } + else + { + echo $e->getMessage(); + } } die;