+ /**
+ * @param Exception|Throwable $e
+ * @return string
+ */
+ private static function getShowBacktraceError( $e ) {
+ global $wgShowExceptionDetails, $wgShowDBErrorBacktrace;
+ $vars = [];
+ if ( !$wgShowExceptionDetails ) {
+ $vars[] = '$wgShowExceptionDetails = true;';
+ }
+ if ( $e instanceof DBError && !$wgShowDBErrorBacktrace ) {
+ $vars[] = '$wgShowDBErrorBacktrace = true;';
+ }
+ $vars = implode( ' and ', $vars );
+ return "Set $vars at the bottom of LocalSettings.php to show detailed debugging information";
+ }
+