tornado: Use a machine-readable error code when an event queue is gone.

This fixes the original issue that #5598 was the root cause of; when
the user returns to a Zulip browser tab after they've been idle past
the timeout (10 min, per IDLE_EVENT_QUEUE_TIMEOUT_SECS), we now
correctly reload the page even if they're using Zulip in German or
another non-English language where we have a translation for the
relevant error message.
This commit is contained in:
Greg Price
2017-07-20 17:20:31 -07:00
committed by Tim Abbott
parent 45b718a2a2
commit 709c3b50fc
6 changed files with 27 additions and 4 deletions

View File

@@ -35,6 +35,7 @@ class ErrorCode(AbstractEnum):
QUOTA_EXCEEDED = ()
BAD_NARROW = ()
UNAUTHORIZED_PRINCIPAL = ()
BAD_EVENT_QUEUE_ID = ()
class JsonableError(Exception):
'''A standardized error format we can turn into a nice JSON HTTP response.