mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-52284 core: compatibility with Exception/Throwable changes in PHP7
This commit is contained in:
parent
0dfcc2541a
commit
d74b7e424f
7 changed files with 43 additions and 8 deletions
|
@ -378,7 +378,13 @@ function default_exception_handler($ex) {
|
|||
$DB->set_debug(0);
|
||||
}
|
||||
echo $OUTPUT->fatal_error($info->message, $info->moreinfourl, $info->link, $info->backtrace, $info->debuginfo);
|
||||
} catch (Exception $out_ex) {
|
||||
} catch (Exception $e) {
|
||||
$out_ex = $e;
|
||||
} catch (Throwable $e) {
|
||||
$out_ex = $e; // PHP7.
|
||||
}
|
||||
|
||||
if (isset($out_ex)) {
|
||||
// default exception handler MUST not throw any exceptions!!
|
||||
// the problem here is we do not know if page already started or not, we only know that somebody messed up in outputlib or theme
|
||||
// so we just print at least something instead of "Exception thrown without a stack frame in Unknown on line 0":-(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue