From 34bf6b1db74801b256211c23cb96594779ba2132 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sun, 6 Oct 2013 19:53:33 +0200 Subject: [PATCH] Fixed JSON mime type and exception handling --- src/Bootstrap.php | 4 +++- src/Views/layout-json.phtml | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Bootstrap.php b/src/Bootstrap.php index 55b659f8..f96e2e59 100644 --- a/src/Bootstrap.php +++ b/src/Bootstrap.php @@ -58,7 +58,9 @@ class Bootstrap } catch (Exception $e) { - $this->context->exception = $e; + $this->context->transport->errorMessage = rtrim($e->getMessage(), '.') . '.'; + $this->context->transport->exception = $e; + $this->context->transport->success = false; $this->context->viewName = 'error-exception'; (new \Chibi\View())->renderFile($this->context->layoutName); } diff --git a/src/Views/layout-json.phtml b/src/Views/layout-json.phtml index 906a16be..95dd6d28 100644 --- a/src/Views/layout-json.phtml +++ b/src/Views/layout-json.phtml @@ -1 +1,2 @@ + context->transport, true) ?>