Skip to content

Commit

Permalink
Throw NotFoundException from Dispatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed Aug 7, 2014
1 parent fdcf8ff commit 4dc6106
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Dispatcher/PageDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
namespace Gt\Dispatcher;

use \Gt\Core\Path;
use \Gt\Response\NotFoundException;

class PageDispatcher extends Dispatcher {

Expand All @@ -18,7 +19,7 @@ public function getPath($uri) {
$pageViewDir_container = dirname($pageViewDir);

if(!is_dir($pageViewDir_container)) {
throw new \Gt\Core\Exception\RequiredAppResourceNotFoundException(
throw new NotFoundException(
$pageViewDir
);
}
Expand Down
1 change: 1 addition & 0 deletions src/Response/NotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class NotFoundException extends \Gt\Core\Exception\GtException {

public function __construct() {
http_response_code(404);
call_user_func_array([parent, "construct"], func_get_args());
}

}#

0 comments on commit 4dc6106

Please sign in to comment.