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>';
+ }
+ 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();
}
- $error_msg .= $exception->getMessage();
- };
+ }
self::printErrorPage($error_msg, $hint);
}
}