Skip to content

Commit

Permalink
MDL-19756 Showing exceptions only in DEBUG_DEVELOPER mode
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasconnault committed Aug 13, 2009
1 parent 3d1df2f commit e57c283
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions lib/outputrenderers.php
Expand Up @@ -1676,7 +1676,7 @@ public function select($select) {
*/
public function radio($option, $name='unnamed') {
static $currentradio = array();

if (empty($currentradio[$name])) {
$currentradio[$name] = 0;
}
Expand Down Expand Up @@ -1847,6 +1847,10 @@ public function fatal_error($message, $moreinfourl, $link, $backtrace,

$output = '';

if (!debugging('', DEBUG_DEVELOPER)) {
return false;
}

if ($this->has_started()) {
$output .= $this->opencontainers->pop_all_but_last();
} else {
Expand All @@ -1861,18 +1865,16 @@ public function fatal_error($message, $moreinfourl, $link, $backtrace,
get_string('moreinformation') . '</a></p>';
$output .= $this->box($message, 'errorbox');

if (debugging('', DEBUG_DEVELOPER)) {
if ($showerrordebugwarning) {
$output .= $this->notification('error() is a deprecated function. ' .
'Please call print_error() instead of error()', 'notifytiny');
}
if (!empty($debuginfo)) {
$output .= $this->notification($debuginfo, 'notifytiny');
}
if (!empty($backtrace)) {
$output .= $this->notification('Stack trace: ' .
format_backtrace($backtrace), 'notifytiny');
}
if ($showerrordebugwarning) {
$output .= $this->notification('error() is a deprecated function. ' .
'Please call print_error() instead of error()', 'notifytiny');
}
if (!empty($debuginfo)) {
$output .= $this->notification($debuginfo, 'notifytiny');
}
if (!empty($backtrace)) {
$output .= $this->notification('Stack trace: ' .
format_backtrace($backtrace), 'notifytiny');
}

if (!empty($link)) {
Expand Down

0 comments on commit e57c283

Please sign in to comment.