BUGFIX: Return correct error when 404 page doesn't exist and page is not found.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@91209 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew O'Neil 2009-11-10 21:47:25 +00:00 committed by Sam Minnee
parent 654af798ee
commit e2a3cb2e20

View File

@ -49,10 +49,14 @@ class ModelAsController extends Controller implements NestedController {
return $this->response;
}
$result = $this->getNestedController();
try {
$result = $this->getNestedController();
if($result instanceof RequestHandler) {
$result = $result->handleRequest($this->request);
if($result instanceof RequestHandler) {
$result = $result->handleRequest($this->request);
}
} catch(SS_HTTPResponse_Exception $responseException) {
$result = $responseException->getResponse();
}
$this->popCurrent();