Skip to content

Commit a5bed6c

Browse files
author
Alistair Kearney
committed
Using API Framework exception and error handlers instead of Symphony built in. (Fixes #9)
1 parent 2df8eeb commit a5bed6c

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/Includes/JsonRendererLauncher.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
<?php
22

33
use Symphony\ApiFramework\Lib;
4+
use \Symphony;
45

56
function renderer_json($mode){
67
if (strtolower($mode) == 'administration') {
7-
throw new Lib\Exceptions\InvalidModeException('JSON Renderer launcher is only availalbe on the frontend');
8+
throw new Lib\Exceptions\InvalidModeException('JSON Renderer launcher is only available on the frontend');
89
}
910

1011
$renderer = Frontend::instance();
1112

13+
// Check if we should enable exception debug information
14+
$exceptionDebugEnabled = Symphony::isLoggedIn();
15+
16+
// Use the JSON exception and error handlers instead of the Symphony one.
17+
Lib\ExceptionHandler::initialise($exceptionDebugEnabled);
18+
Lib\ErrorHandler::initialise($exceptionDebugEnabled);
19+
1220
// #1808
1321
if (isset($_SERVER['HTTP_MOD_REWRITE']))
1422
{

0 commit comments

Comments
 (0)