]> source.dussan.org Git - nextcloud-server.git/commitdiff
Do not use L10n when logging exceptions
authorVincent Petry <pvince81@owncloud.com>
Mon, 16 Dec 2013 14:04:02 +0000 (15:04 +0100)
committerVincent Petry <pvince81@owncloud.com>
Mon, 16 Dec 2013 14:11:13 +0000 (15:11 +0100)
In some specific situations, the L10N bundle isn't loadable yet (for
example when there is an issue with the app_config table). In such case,
we still want to be able to log the real exception.

This fixes errors that say "OC_L10N_String::__toString must not throw
exceptions"

lib/private/template.php
lib/public/util.php

index 9b2c1211e61c8e2b3dbb21c02c2dabfe87a5399d..b2c3a20f281056d8515f8a36d2d09759ee9d493c 100644 (file)
@@ -292,9 +292,8 @@ class OC_Template extends \OC\Template\Base {
                        if (!empty($hint)) {
                                $hint = '<pre>'.$hint.'</pre>';
                        }
-                       $l = OC_L10N::get('lib');
                        while (method_exists($exception, 'previous') && $exception = $exception->previous()) {
-                               $error_msg .= '<br/>'.$l->t('Caused by:').' ';
+                               $error_msg .= '<br/>Caused by:' . ' ';
                                if ($exception->getCode()) {
                                        $error_msg .= '['.$exception->getCode().'] ';
                                }
index 1d76fd1e1f77624114bd461f67626ba2da7b871a..8e85f9afc3fadb9057b4c8e119121f11758df683 100644 (file)
@@ -103,9 +103,8 @@ class Util {
                        }
 
                        // include cause
-                       $l = \OC_L10N::get('lib');
                        while (method_exists($ex, 'getPrevious') && $ex = $ex->getPrevious()) {
-                               $message .= ' - '.$l->t('Caused by:').' ';
+                               $message .= ' - Caused by:' . ' ';
                                $message .= $ex->getMessage();
                                if ($ex->getCode()) {
                                        $message .= '[' . $ex->getCode() . '] ';