resourceloader: Don't localise hidden exception
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 15 Sep 2015 18:35:13 +0000 (19:35 +0100)
committerKrinkle <krinklemail@gmail.com>
Wed, 16 Sep 2015 04:14:39 +0000 (04:14 +0000)
Mechanical stacktraces are mostly program identifiers (which are English) with some
glue text.

When stacktraces are disabled by the site admin, the replacement message doesn't
seem valuable to localise. And one could argue it should be in the user language
instead of the site language in that case, which complicates the output buffer
and caching layers for this.

It also reduces coupling with MediaWiki (Ref T32956).

Change-Id: If446f1b815add2be4baf1c333f18a4bab0cc9c37

includes/resourceloader/ResourceLoader.php

index da74b35..173fcc1 100644 (file)
@@ -940,11 +940,11 @@ class ResourceLoader implements LoggerAwareInterface {
        protected static function formatExceptionNoComment( $e ) {
                global $wgShowExceptionDetails;
 
-               if ( $wgShowExceptionDetails ) {
-                       return $e->__toString();
-               } else {
-                       return wfMessage( 'internalerror' )->text();
+               if ( !$wgShowExceptionDetails ) {
+                       return 'Internal error';
                }
+
+               return $e->__toString();
        }
 
        /**