[Pkg-owncloud-commits] [owncloud] 12/104: Do not use L10n when logging exceptions

David Prévot taffit at moszumanska.debian.org
Sat Jan 18 13:33:36 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit ae58a385b7a47da870c05ebd446a008ce804ab8f
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Mon Dec 16 15:04:02 2013 +0100

    Do not use L10n when logging exceptions
    
    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 | 3 +--
 lib/public/util.php      | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/lib/private/template.php b/lib/private/template.php
index 9b2c121..b2c3a20 100644
--- a/lib/private/template.php
+++ b/lib/private/template.php
@@ -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().'] ';
 				}
diff --git a/lib/public/util.php b/lib/public/util.php
index 1d76fd1..8e85f9a 100644
--- a/lib/public/util.php
+++ b/lib/public/util.php
@@ -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() . '] ';

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list