Skip to content

Commit

Permalink
Catch 404 errors in Dispatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed Aug 7, 2014
1 parent 4dc6106 commit 9432b68
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Dispatcher/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use \Gt\Response\Response;
use \Gt\Api\ApiFactory;
use \Gt\Database\DatabaseFactory;
use \Gt\Response\NotFoundException;

abstract class Dispatcher {

Expand Down Expand Up @@ -69,8 +70,14 @@ public function process() {
$filename = $this->request->indexFilename;
}

// Load the source view from the path on disk and requested filename.
$source = $this->loadSource($path, $filename);
try {
// Load the source view from the path on disk and requested filename.
$source = $this->loadSource($path, $filename);
}
catch(NotFoundException $e) {
// TODO: Handle 404 error here.
}

// Instantiate the response content object, for manipulation in Code.
$content = $this->createResponseContent($source);

Expand Down

0 comments on commit 9432b68

Please sign in to comment.