Merge branch 'MDL-55951-master' of git://github.com/crazyserver/moodle

This commit is contained in:
Eloy Lafuente (stronk7) 2016-09-27 23:59:21 +02:00
commit b58bbbd4f1
2 changed files with 6 additions and 4 deletions

View file

@ -2678,7 +2678,7 @@ EOD;
* @param string $debuginfo Debugging information
* @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;
$output = '';
@ -4382,7 +4382,7 @@ class core_renderer_cli extends core_renderer {
* @param string $debuginfo Debugging information
* @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;
$output = "!!! $message !!!\n";
@ -4457,13 +4457,14 @@ class core_renderer_ajax extends core_renderer {
* @param string $debuginfo Debugging information
* @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;
$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->error = $message;
$e->errorcode = $errorcode;
$e->stacktrace = NULL;
$e->debuginfo = NULL;
$e->reproductionlink = NULL;

View file

@ -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
$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) {
$out_ex = $e;
} catch (Throwable $e) {