Merge "exception: Add newline at the end of a debugging line for CLI users"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 26 Apr 2017 21:35:33 +0000 (21:35 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 26 Apr 2017 21:35:33 +0000 (21:35 +0000)
1  2 
includes/exception/MWExceptionRenderer.php

   * @author Aaron Schulz
   */
  
 +use Wikimedia\Rdbms\DBConnectionError;
 +use Wikimedia\Rdbms\DBError;
 +use Wikimedia\Rdbms\DBReadOnlyError;
 +use Wikimedia\Rdbms\DBExpectedError;
 +
  /**
   * Class to expose exceptions to the client (API bots, users, admins using CLI scripts)
   * @since 1.28
@@@ -47,10 -42,10 +47,10 @@@ class MWExceptionRenderer 
                } elseif ( self::isCommandLine() ) {
                        self::printError( self::getText( $e ) );
                } elseif ( $mode === self::AS_PRETTY ) {
 +                      self::statusHeader( 500 );
                        if ( $e instanceof DBConnectionError ) {
                                self::reportOutageHTML( $e );
                        } else {
 -                              self::statusHeader( 500 );
                                self::header( "Content-Type: $wgMimeType; charset=utf-8" );
                                self::reportHTML( $e );
                        }
                        $vars[] = '$wgShowDBErrorBacktrace = true;';
                }
                $vars = implode( ' and ', $vars );
-               return "Set $vars at the bottom of LocalSettings.php to show detailed debugging information";
+               return "Set $vars at the bottom of LocalSettings.php to show detailed debugging information\n";
        }
  
        /**