AbuseFilter and SpamBlacklist return a "successful" action=edit API response when they prevent edits. Here's an example for AbuseFilter:
{ "edit": { "code": "abusefilter-disallowed", "message": { "key": "abusefilter-disallowed", "params": [ ... ] }, "abusefilter": { ... }, "info": "Hit AbuseFilter: Test filter disallow", "warning": "This action has been automatically identified ...", "result": "Failure" } }
Other than being annoyingly inconsistent, this output doesn't support the errorformat parameter.
This is because they use 'apiHookResult' property to define the error message, and they should instead use ApiMessage.
For comparison, a 'readonly' error generated by MediaWiki (with errorformat=html):
{ "errors": [ { "code": "readonly", "data": { "readonlyreason": "foo bar" }, "module": "main", "*": "The wiki is currently in read-only mode." } ], "*": "See http://localhost:3080/w/api.php for API usage. ..." }
For another comparison, an error generated by TitleBlacklist (with errorformat=html):
{ "errors": [ { "code": "titleblacklist-forbidden", "data": { "message": { "key": "titleblacklist-forbidden-edit", "params": [ ...] }, "line": ..., "info": "TitleBlacklist prevents this title from being created" }, "module": "edit", "*": "The title ..." } ], "*": "See http://localhost:3080/w/api.php for API usage. ..." }