Last modified: 2014-11-19 10:47:02 UTC
Seen coming from edit preview & edit section: https://ticket.wikimedia.org/otrs/index.pl?Action=AgentTicketZoom;TicketID=7786983 https://ticket.wikimedia.org/otrs/index.pl?Action=AgentTicketZoom;TicketID=7752648 Maybe something to do with server error pages?
Yes, I think this happens when there's a server problem. I ran into this myself a couple of days ago. The client should handle these kinds of errors without crashing, of course.
https://ticket.wikimedia.org/otrs/index.pl?Action=AgentTicketZoom&TicketID=7896217
https://gerrit.wikimedia.org/r/168313
So, when there's a server error (500), it returns an HTML response instead of a JSON response; that's why the response begins with "<!DOCTYPE..." This condition is actually handled correctly in the java-mwapi layer, and is thrown as an ApiException. There were simply some cases in the Editing workflow where ApiException was still not being caught properly.
Sounds like this is fixed then.
https://ticket.wikimedia.org/otrs/index.pl?Action=AgentTicketZoom&TicketID=7966282 is a similar crash, from the alpha updater. I particularly like how the code that throws this JSONException as a RuntimeException says "// This never happens"