In case of misisng view file, render in JSON

This commit is contained in:
Marcin Kurczewski 2013-11-05 09:27:34 +01:00
parent 09b5a38c95
commit bb0e844e4e
2 changed files with 7 additions and 1 deletions

@ -1 +1 @@
Subproject commit beeb483bbeef8102fb54f7197d693b0934f063e1
Subproject commit 0ec5cbda4b34f6273e2e02196cf6c16379623bb3

View file

@ -51,6 +51,12 @@ class Bootstrap
$this->context->viewName = 'error-simple';
(new \Chibi\View())->renderFile($this->context->layoutName);
}
catch (\Chibi\MissingViewFileException $e)
{
$this->context->json = true;
$this->context->layoutName = 'layout-json';
(new \Chibi\View())->renderFile($this->context->layoutName);
}
catch (Exception $e)
{
$this->context->transport->errorMessage = rtrim($e->getMessage(), '.') . '.';