Elgg
Version master
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
views
json
messages
exceptions
admin_exception.php
Go to the documentation of this file.
1
<?php
9
use
Elgg\Exceptions\DatabaseException
;
10
11
$exception
=
elgg_extract
(
'object'
,
$vars
);
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
);
$result
if(!$exception instanceof Throwable) $result
Definition:
admin_exception.php:16
DatabaseException
elgg_extract
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
$exception
Elgg exception (failsafe mode) Displays a single exception.
Definition:
admin_exception.php:11
Elgg\Exceptions\DatabaseException
A generic parent class for database exceptions.
Definition:
DatabaseException.php:10
$vars
$vars
Definition:
theme.php:5
Generated on Sat Dec 21 2024 00:02:54 for Elgg by
1.8.11