Fixed JSON mime type and exception handling
This commit is contained in:
parent
2cd7541042
commit
34bf6b1db7
2 changed files with 4 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
<?php \Chibi\HeadersHelper::set('Content-Type', 'application/json') ?>
|
||||
<?php echo json_encode($this->context->transport, true) ?>
|
||||
|
|
Loading…
Reference in a new issue