summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2013-07-21 22:56:21 +0200
committerBart Visscher <bartv@thisnet.nl>2013-07-21 22:56:21 +0200
commit25e3c9cbeb7b6e643c748fcf393509c3a32b68d6 (patch)
tree7d5ff35eb12e90de5c6dfe837e10ae5f462e71f5
parentaa22194a09538572e55b36f76f846c33b0016813 (diff)
downloadnextcloud-server-25e3c9cbeb7b6e643c748fcf393509c3a32b68d6.tar.gz
nextcloud-server-25e3c9cbeb7b6e643c748fcf393509c3a32b68d6.zip
Only display call trace in debug mode
-rw-r--r--lib/template.php27
1 files changed, 17 insertions, 10 deletions
diff --git a/lib/template.php b/lib/template.php
index d48e3b36821..2b94fb6725c 100644
--- a/lib/template.php
+++ b/lib/template.php
@@ -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>';
+ }
+ 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);
}
}