Only display call trace in debug mode
This commit is contained in:
parent
aa22194a09
commit
25e3c9cbeb
|
@ -531,17 +531,24 @@ class OC_Template{
|
|||
if ($exception->getCode()) {
|
||||
$error_msg = '['.$exception->getCode().'] '.$error_msg;
|
||||
}
|
||||
$hint = $exception->getTraceAsString();
|
||||
if (!empty($hint)) {
|
||||
$hint = '<pre>'.$hint.'</pre>';
|
||||
}
|
||||
while (method_exists($exception,'previous') && $exception = $exception->previous()) {
|
||||
$error_msg .= '<br/>Caused by: ';
|
||||
if ($exception->getCode()) {
|
||||
$error_msg .= '['.$exception->getCode().'] ';
|
||||
if (defined('DEBUG') and DEBUG) {
|
||||
$hint = $exception->getTraceAsString();
|
||||
if (!empty($hint)) {
|
||||
$hint = '<pre>'.$hint.'</pre>';
|
||||
}
|
||||
$error_msg .= $exception->getMessage();
|
||||
};
|
||||
while (method_exists($exception,'previous') && $exception = $exception->previous()) {
|
||||
$error_msg .= '<br/>Caused by: ';
|
||||
if ($exception->getCode()) {
|
||||
$error_msg .= '['.$exception->getCode().'] ';
|
||||
}
|
||||
$error_msg .= $exception->getMessage();
|
||||
};
|
||||
} else {
|
||||
$hint = '';
|
||||
if ($exception instanceof \OC\HintException) {
|
||||
$hint = $exception->getHint();
|
||||
}
|
||||
}
|
||||
self::printErrorPage($error_msg, $hint);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue