Provide useful error details when publishing fails

Authored by santhosh.


Provide useful error details when publishing fails

From our logs, we see 4 main reasons for publishing failures.

  1. Timeout. Related to network.
  2. spamblacklist catching URLs in translation.
  3. User blocked from editing. Now we don't allow these users to see Special:CX at all, see Ib6cdcc2e5f6e7fc631e5ff7d1d3a4f812f5fa6a6
  4. Parsoid failed to convert the HTML to wikitext.

For all of these, provide a brief hint in the publishing error message.

Here is a way to trick CX and create a publishing error:
Translate any article.
Add a section without any reference to translation.
Clear the paragraph completely. The publish button will get disabled.
Now type a space in the empty paragraph.
The publish button will get enabled again.
Publish the page and get the error:
"An error occurred while publishing the translation.
Please try to publish the page again. Error: html cannot be empty".

Bug: T100498
Change-Id: Ia96ec15a4d44c7c1403542bdd1e25660984fad8b