Page MenuHomePhabricator

Include page id and page name in API editconflict error
Open, LowestPublic

Description

Hi! I want to express a wish here, to output the page title and/or page id to be edited in the error return of an edit conflict by API:

Editconflict return now:

{
    "error": {
        "code": "editconflict",
        "info": "Edit conflict: $1",
        "*": "See https://test2.wikipedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."
    },
    "servedby": "mw1280"
}

Wished editconflict return then:

{
    "error": {
        "code": "editconflict",
        "info": "Edit conflict: $1",
        "*": "See https://test2.wikipedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."
        "title": "Example",
        "pageid": 12345,
    },
    "servedby": "mw1280"
}

This change will be better to find or comprehend the error according to those error logs.

What is your meaning about this?

(I also subscribe the Team of WMDE Technical Wishes to seek for any help)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 18 2018, 12:20 PM
doctaxon updated the task description. (Show Details)Mar 18 2018, 12:21 PM
doctaxon updated the task description. (Show Details)

I don't see any relation to the infrastructure behind wikitech.wikimedia.org here?

Reedy renamed this task from Technical wish: API error message editconflict to Include page id and page name in API errors.Mar 19 2018, 9:51 AM
Anomie renamed this task from Include page id and page name in API errors to Include page id and page name in API editconflict error.Mar 19 2018, 1:37 PM
Anomie updated the task description. (Show Details)
Anomie triaged this task as Lowest priority.Mar 19 2018, 1:41 PM
Anomie added subscribers: Reedy, Anomie.

@Reedy renamed this task from Technical wish: API error message editconflict to Include page id and page name in API errors.

"API errors" is far too generic. Changing this back to being specific to edit conflicts, and updating the description so the examples are in a readable format.

IMO you should probably already know the title or page ID since you submitted it with the post to action=edit, except maybe in the case of the redirect parameter. But if someone really wants to do this, start by looking at the $data parameter to ApiBase::dieWithError().

Anomie moved this task from Unsorted to Needs Code on the MediaWiki-API board.Mar 19 2018, 1:41 PM
Xqt added a subscriber: Xqt.Feb 22 2019, 7:49 AM