Deprecate wfDebugDieBacktrace
authorKevin Israel <pleasestand@live.com>
Fri, 27 Sep 2013 23:57:41 +0000 (19:57 -0400)
committerKevin Israel <pleasestand@live.com>
Fri, 27 Sep 2013 23:57:41 +0000 (19:57 -0400)
Change-Id: I12336983e29524a450fc61ed9df4d840066be9b6

includes/GlobalFunctions.php
includes/api/ApiBase.php
languages/Language.php
maintenance/generateSitemap.php

index 414c822..d6e6615 100644 (file)
@@ -1703,10 +1703,12 @@ function wfEmptyMsg( $key ) {
  * Throw a debugging exception. This function previously once exited the process,
  * but now throws an exception instead, with similar results.
  *
+ * @deprecated since 1.22; just throw an MWException yourself
  * @param string $msg message shown when dying.
  * @throws MWException
  */
 function wfDebugDieBacktrace( $msg = '' ) {
+       wfDeprecated( __FUNCTION__, '1.22' );
        throw new MWException( $msg );
 }
 
index 2e6846d..ce6ecda 100644 (file)
@@ -1503,7 +1503,7 @@ abstract class ApiBase extends ContextSource {
         * @param string $message Error message
         */
        protected static function dieDebug( $method, $message ) {
-               wfDebugDieBacktrace( "Internal error in $method: $message" );
+               throw new MWException( "Internal error in $method: $message" );
        }
 
        /**
index f1b7fa6..527f382 100644 (file)
@@ -2617,7 +2617,7 @@ class Language {
         */
        function checkTitleEncoding( $s ) {
                if ( is_array( $s ) ) {
-                       wfDebugDieBacktrace( 'Given array to checkTitleEncoding.' );
+                       throw new MWException( 'Given array to checkTitleEncoding.' );
                }
                if ( StringUtils::isUtf8( $s ) ) {
                        return $s;
index 4f6bed5..0b21a1f 100644 (file)
@@ -378,7 +378,7 @@ class GenerateSitemap extends Maintenance {
        function open( $file, $flags ) {
                $resource = $this->compress ? gzopen( $file, $flags ) : fopen( $file, $flags );
                if ( $resource === false ) {
-                       wfDebugDieBacktrace( __METHOD__ . " error opening file $file with flags $flags. Check permissions?" );
+                       throw new MWException( __METHOD__ . " error opening file $file with flags $flags. Check permissions?" );
                }
                return $resource;
        }
@@ -388,7 +388,7 @@ class GenerateSitemap extends Maintenance {
         */
        function write( &$handle, $str ) {
                if ( $handle === true || $handle === false ) {
-                       wfDebugDieBacktrace( __METHOD__ . " was passed a boolean as a file handle.\n" );
+                       throw new MWException( __METHOD__ . " was passed a boolean as a file handle.\n" );
                }
                if ( $this->compress ) {
                        gzwrite( $handle, $str );