From: Timo Tijhof Date: Fri, 28 Sep 2018 21:44:36 +0000 (+0100) Subject: exception: Add FIXME about code duplication X-Git-Tag: 1.34.0-rc.0~3965^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/%28%5B%5E/fichier?a=commitdiff_plain;h=9512ebe7365b5384d918490654e5f37176ad1e35;p=lhc%2Fweb%2Fwiklou.git exception: Add FIXME about code duplication These methods aren't identical, so consolidation isn't immediately obvious, and creating dependencies is problematic in error handling code given there is a lot of pressure on this code to not by itself cause additional errors. This means that maybe it's best to keep these inlined without duplication, but at the very least we then need to remember to keep these in sync. This duplication has been around for a while now, but documentation can never come too late... Change-Id: I60160f61c13c8e115d839acce222f110e30bc2f2 --- diff --git a/includes/exception/MWException.php b/includes/exception/MWException.php index ffeafff50e..af835e4776 100644 --- a/includes/exception/MWException.php +++ b/includes/exception/MWException.php @@ -76,6 +76,7 @@ class MWException extends Exception { global $wgSitename; $args = array_slice( func_get_args(), 2 ); + // FIXME: Keep logic in sync with MWExceptionRenderer::msg. $res = false; if ( $this->useMessageCache() ) { try { diff --git a/includes/exception/MWExceptionRenderer.php b/includes/exception/MWExceptionRenderer.php index 503638303f..de2af6bd14 100644 --- a/includes/exception/MWExceptionRenderer.php +++ b/includes/exception/MWExceptionRenderer.php @@ -199,6 +199,8 @@ class MWExceptionRenderer { private static function msg( $key, $fallback /*[, params...] */ ) { global $wgSitename; $args = array_slice( func_get_args(), 2 ); + + // FIXME: Keep logic in sync with MWException::msg. try { $res = wfMessage( $key, $args )->text(); } catch ( Exception $e ) {