mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Merge branch 'MDL-55951-master' of git://github.com/crazyserver/moodle
This commit is contained in:
commit
b58bbbd4f1
2 changed files with 6 additions and 4 deletions
|
@ -2678,7 +2678,7 @@ EOD;
|
||||||
* @param string $debuginfo Debugging information
|
* @param string $debuginfo Debugging information
|
||||||
* @return string the HTML to output.
|
* @return string the HTML to output.
|
||||||
*/
|
*/
|
||||||
public function fatal_error($message, $moreinfourl, $link, $backtrace, $debuginfo = null) {
|
public function fatal_error($message, $moreinfourl, $link, $backtrace, $debuginfo = null, $errorcode = "") {
|
||||||
global $CFG;
|
global $CFG;
|
||||||
|
|
||||||
$output = '';
|
$output = '';
|
||||||
|
@ -4382,7 +4382,7 @@ class core_renderer_cli extends core_renderer {
|
||||||
* @param string $debuginfo Debugging information
|
* @param string $debuginfo Debugging information
|
||||||
* @return string A template fragment for a fatal error
|
* @return string A template fragment for a fatal error
|
||||||
*/
|
*/
|
||||||
public function fatal_error($message, $moreinfourl, $link, $backtrace, $debuginfo = null) {
|
public function fatal_error($message, $moreinfourl, $link, $backtrace, $debuginfo = null, $errorcode = "") {
|
||||||
global $CFG;
|
global $CFG;
|
||||||
|
|
||||||
$output = "!!! $message !!!\n";
|
$output = "!!! $message !!!\n";
|
||||||
|
@ -4457,13 +4457,14 @@ class core_renderer_ajax extends core_renderer {
|
||||||
* @param string $debuginfo Debugging information
|
* @param string $debuginfo Debugging information
|
||||||
* @return string A template fragment for a fatal error
|
* @return string A template fragment for a fatal error
|
||||||
*/
|
*/
|
||||||
public function fatal_error($message, $moreinfourl, $link, $backtrace, $debuginfo = null) {
|
public function fatal_error($message, $moreinfourl, $link, $backtrace, $debuginfo = null, $errorcode = "") {
|
||||||
global $CFG;
|
global $CFG;
|
||||||
|
|
||||||
$this->page->set_context(null); // ugly hack - make sure page context is set to something, we do not want bogus warnings here
|
$this->page->set_context(null); // ugly hack - make sure page context is set to something, we do not want bogus warnings here
|
||||||
|
|
||||||
$e = new stdClass();
|
$e = new stdClass();
|
||||||
$e->error = $message;
|
$e->error = $message;
|
||||||
|
$e->errorcode = $errorcode;
|
||||||
$e->stacktrace = NULL;
|
$e->stacktrace = NULL;
|
||||||
$e->debuginfo = NULL;
|
$e->debuginfo = NULL;
|
||||||
$e->reproductionlink = NULL;
|
$e->reproductionlink = NULL;
|
||||||
|
|
|
@ -384,7 +384,8 @@ function default_exception_handler($ex) {
|
||||||
// If you enable db debugging and exception is thrown, the print footer prints a lot of rubbish
|
// If you enable db debugging and exception is thrown, the print footer prints a lot of rubbish
|
||||||
$DB->set_debug(0);
|
$DB->set_debug(0);
|
||||||
}
|
}
|
||||||
echo $OUTPUT->fatal_error($info->message, $info->moreinfourl, $info->link, $info->backtrace, $info->debuginfo);
|
echo $OUTPUT->fatal_error($info->message, $info->moreinfourl, $info->link, $info->backtrace, $info->debuginfo,
|
||||||
|
$info->errorcode);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$out_ex = $e;
|
$out_ex = $e;
|
||||||
} catch (Throwable $e) {
|
} catch (Throwable $e) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue