We should avoid using the APIEditBeforeSave hook to return precise error messages in the API. It only provides the page text as submitted by the API user, which is different from the actual page text to be saved in case of section edits and automerged edit conflicts. The EditFilterMergedContent hook allows doing this since MW 1.25 (09a5febb7b024c0b6585141bb05cba13a642f3eb / https://gerrit.wikimedia.org/r/#/c/177747/).
Example fix, for AbuseFilter: https://gerrit.wikimedia.org/r/#/c/282100/
Extensions currently using the APIEditBeforeSave hook:
* AbuseFilter ({icon check} OK, only for compatibility with MW pre-1.25; removing in https://gerrit.wikimedia.org/r/294728)
* ConfirmEdit ({icon check} OK, only for compatibility with MW pre-1.25; removing in https://gerrit.wikimedia.org/r/294730)
* SpamBlacklist (??? probably not OK)
* ProofreadPage (???)