From: Sam Reed Date: Fri, 13 Jan 2012 23:14:28 +0000 (+0000) Subject: Rather than using an error code of unknownerror, use the error code returned by EditP... X-Git-Tag: 1.31.0-rc.0~25287 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=b28e16864559d7cec84563f9a830d0ad04b285c3;p=lhc%2Fweb%2Fwiklou.git Rather than using an error code of unknownerror, use the error code returned by EditPage if it's a string, and it has length, else just return the usual "unknownerror" --- diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php index 216468cc99..9ed6d08da7 100644 --- a/includes/api/ApiEditPage.php +++ b/includes/api/ApiEditPage.php @@ -347,7 +347,11 @@ class ApiEditPage extends ApiBase { $this->dieUsageMsg( $errors[0] ); // TODO: Add new errors to message map break; default: - $this->dieUsageMsg( array( 'unknownerror', $status->value ) ); + if ( is_string( $status->value ) && strlen( $status->value ) ) { + $this->dieUsage( "An unknown return value was returned by Editpage. The code returned was \"{$status->value}\"" , $status->value ); + } else { + $this->dieUsageMsg( array( 'unknownerror', $status->value ) ); + } } $apiResult->addValue( null, $this->getModuleName(), $r ); }