From be1cd24b806d3e0b41220bc9f05be5f327c42ac1 Mon Sep 17 00:00:00 2001 From: Bryan Tong Minh Date: Wed, 28 Oct 2009 13:35:39 +0000 Subject: [PATCH] Throw a bit more helpful unknownerror at AS_END, indicating that AS_END was encountered. This actually needs fixing higher up, but this at least clarifies for now what kind of unknownerror occurred. --- includes/api/ApiEditPage.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php index b6b21d5b35..ccca3736f6 100644 --- a/includes/api/ApiEditPage.php +++ b/includes/api/ApiEditPage.php @@ -268,10 +268,6 @@ class ApiEditPage extends ApiBase { #case EditPage::AS_SUMMARY_NEEDED: Can't happen since we set wpIgnoreBlankSummary case EditPage::AS_TEXTBOX_EMPTY: $this->dieUsageMsg(array('emptynewsection')); - case EditPage::AS_END: - # This usually means some kind of race condition - # or DB weirdness occurred. Throw an unknown error here. - $this->dieUsageMsg(array('unknownerror')); case EditPage::AS_SUCCESS_NEW_ARTICLE: $r['new'] = ''; case EditPage::AS_SUCCESS_UPDATE: @@ -294,6 +290,14 @@ class ApiEditPage extends ApiBase { $newArticle->getTimestamp()); } break; + case EditPage::AS_END: + # This usually means some kind of race condition + # or DB weirdness occurred. Fall through to throw an unknown + # error. + + # This needs fixing higher up, as Article::doEdit should be + # used rather than Article::updateArticle, so that specific + # error conditions can be returned default: $this->dieUsageMsg(array('unknownerror', $retval)); } -- 2.20.1