* 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 );
}
* @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" );
}
/**
*/
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;
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;
}
*/
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 );