[01:47:41] Weird, action=edit does not emit an "error" property at the top-level when abuse filter prevents an edit (API) [01:47:48] The code does dieWithError("hookaborted") [01:48:15] yet the response is just { edit: { result: Failure, code: .., message: .., warning: .., abusefilter: {} } [01:48:25] but no { error: { code: .., info: .. } } [01:48:36] This means using the API through nodemw, results in just "Edit failed: null" [01:48:39] which isn't very useful :P [01:49:10] The string 'hookaborted' nor the contents of its message appear in the API output. I thought it used it. [01:49:12] to [01:49:41] ( Krenair: ^ is why mw-tool-tourbot doesn't report anything about the error ) [01:50:25] I tried to hack nodemw to show it and in doing so, I spotted its assumption that data.error should exist in this situation, (!data.edit || data.edit.result != 'Success') [01:51:21] "Deprecated in favour of EditFilterMergedContent" [01:51:22] Hm.. [01:52:16] Meh, end result should be the same [01:56:14] Its generic request layer assumes that if no http/json error happened, and no data.error exists, it's fine, and defers to edit() handling, which then checks .result for Success, and if not, passes err to new Error, where err came from (http.err || json.err || data.error) [02:00:56] Krinkle: for some reason action=edit uses { result: Failure } for errors and we haven't switched it to use normal API error handling because of back-compat [03:03:33] legoktm: Hm.. okay, so it's always been this way/ [03:03:39] Well, that'll make it easier to justify a change [03:16:48] legoktm: Hm.. aside from 'result' being "Failure", looks like the .code and .info properties are not standardised there. They are for the new-level 'error' object', but not for the 'edit' object. [03:17:10] Those are manually set by AbuseFilter. And basically just for internal consumption by its frontend. [03:17:29] Things like VE only work well with it, because of AbuseFilter-specific code. [03:17:34] So can't really code anything for it. [03:17:36] Oh wel l:) [03:21:06] Krinkle: You can just check for result: Failure and see if the AF keys exist? [03:21:21] legoktm: They do, but are not forwarded by nodemw because they're non-standard. [03:21:48] All I get is function(err, data), where for errors data=null, and err is 'new Error("Edit failed " + data.error) [03:21:53] which is "edit failed null" [03:22:03] (effectively, not literally that) [03:22:44] https://github.com/macbre/nodemw/blob/devel/lib/bot.js#L515-L521 [03:22:48] bot.edit ^ [03:23:05] https://github.com/macbre/nodemw/blob/devel/lib/api.js#L209-L215 [03:23:07] api.call ^ [03:24:26] Woo [03:24:29] Fixed upstream [03:24:30] https://github.com/macbre/nodemw/commit/3456ff373062920b0babfb0fddc2d4b8094be8f0 [03:25:04] So with this, I should get the whole object and I can at the very least dump it to the console [03:25:07] Nevermind :) [03:25:38] Krinkle: https://phabricator.wikimedia.org/T57460 [03:25:55] Thanks