Page MenuHomePhabricator
Paste P8993

(An Untitled Masterwork)

Authored by matmarex on Aug 28 2019, 1:43 PM.
BREAKING CHANGE: Action API action=edit error messages from AbuseFilter and SpamBlacklist
When saving an edit is prevented by the AbuseFilter or SpamBlacklist extensions, the format of the API error response will be different.
The extensions previously used a different format for their API error responses than the usual used by core MediaWiki and other extensions, indicating the failure with `.edit.result == 'Failure'`. They will now return a response with a top-level `.error` or `.errors` object, depending on 'errorformat', same as for any other error condition in the API.
The motivation for this change is to allow error handling in API consumers to be simplified, especially those using 'errorformat=html'. If your tool had custom error handling for this case, it can be removed and replaced by the general error handling code you probably already have. Note that the ConfirmEdit (CAPTCHA) extension still uses the old format.
Sample API error responses:
* AbuseFilter
* Before:
* After:
* SpamBlacklist
* Before:
* After:
* Generic error message for comparison:
See for relevant patches and discussion.

Event Timeline

matmarex created this paste.Aug 28 2019, 1:43 PM