Page MenuHomePhabricator

TitleBlacklist's error message in the API has no machine-readable information that it's caused by a blacklisted title
Closed, ResolvedPublic

Description

TitleBlacklist's error message in the API has no machine-readable information that it's caused by a blacklisted title.

For example:

{
  "servedby": "deployment-mediawiki01",
  "error": {
    "info": "TitleBlacklist prevents this title from being created",
    "code": "senselessimagename",
    "invalidparameter": "filename",
    "filekey": "13i5i0u8vv8w.5sc2g2.1252.jpg",
    "*": "See http://commons.wikimedia.beta.wmflabs.org/w/api.php for API usage",
    "sessionkey": "13i5i0u8vv8w.5sc2g2.1252.jpg"
  }
}

The code is actually defined on-wiki in 'MediaWiki:Titleblacklist', and the info (which is meant to be a human-readable fallback when API client can't handle the code) is the only indication that TitleBlacklist was involved.

code should always be the same for TitleBlacklist-related errors, with the current code returned as some additional parameter in the response.

Details

Related Gerrit Patches:
mediawiki/core : masterAllow passing detailed permission errors data to API
mediawiki/extensions/TitleBlacklist : masterReturn better error information via the API

Event Timeline

matmarex created this task.Oct 12 2015, 2:03 PM
matmarex claimed this task.
matmarex raised the priority of this task from to Normal.
matmarex updated the task description. (Show Details)
matmarex added a project: TitleBlacklist.
matmarex added a subscriber: Anomie.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 12 2015, 2:03 PM

Summarizing from the IRC discussion, the ideal thing here would probably be

  1. Have TitleBlacklist return an ApiMessage with appropriate values set for the code and data.
  2. Make sure everything in the relevant call paths can handle getting a Message rather than a key+parameters array.
  3. Make sure ApiUpload actually recognizes the ApiMessage for what it is and does the right thing with it.

Change 247275 had a related patch set uploaded (by Bartosz Dziewoński):
[WIP] Allow passing detailed permission errors data to API

https://gerrit.wikimedia.org/r/247275

Change 247276 had a related patch set uploaded (by Bartosz Dziewoński):
[WIP] Return better error information via the API

https://gerrit.wikimedia.org/r/247276

matmarex raised the priority of this task from Normal to High.Oct 19 2015, 5:06 PM
matmarex set Security to None.

Change 247275 merged by jenkins-bot:
Allow passing detailed permission errors data to API

https://gerrit.wikimedia.org/r/247275

Change 247276 merged by jenkins-bot:
Return better error information via the API

https://gerrit.wikimedia.org/r/247276

Krenair closed this task as Resolved.Nov 4 2015, 10:43 PM
Krenair added a subscriber: Krenair.

Change 251195 had a related patch set uploaded (by Bartosz Dziewoński):
mw.UploadWizardDetails: Upload TitleBlacklist error handling for T115258

https://gerrit.wikimedia.org/r/251195

Change 251195 merged by jenkins-bot:
mw.UploadWizardDetails: Upload TitleBlacklist error handling for T115258

https://gerrit.wikimedia.org/r/251195