Skip to content

Commit

Permalink
Route Exception fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonagnew committed Jun 9, 2015
1 parent d20abf6 commit 64d2cf8
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Herbert/Framework/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 64d2cf8

Please sign in to comment.