From b28e16864559d7cec84563f9a830d0ad04b285c3 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Fri, 13 Jan 2012 23:14:28 +0000 Subject: [PATCH] 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" --- includes/api/ApiEditPage.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 ); } -- 2.20.1