Elgg  Version master
admin_exception.php
Go to the documentation of this file.
1 <?php
10 
12 if (!$exception instanceof Throwable) {
13  return;
14 }
15 
16 $result = new stdClass();
17 $result->error = get_class($exception);
18 $result->ts = (int) elgg_extract('ts', $vars);
19 $result->message = $exception->getMessage();
20 
21 if ($exception instanceof DatabaseException) {
22  $result->query = $exception->getQuery();
23  $result->params = $exception->getParameters();
24 } else {
25  $result->trace = $exception->getTrace();
26 }
27 
28 echo json_encode($result);
if(!$exception instanceof Throwable) $result
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:254
$exception
Elgg exception (failsafe mode) Displays a single exception.
A generic parent class for database exceptions.
$vars
Definition: theme.php:5