Files
zulip/zerver/tornado/exceptions.py
Greg Price 709c3b50fc 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.
2017-07-24 16:41:22 -07:00

20 lines
522 B
Python

from __future__ import absolute_import
from typing import Text
from django.utils.translation import ugettext as _
from zerver.lib.exceptions import JsonableError, ErrorCode
class BadEventQueueIdError(JsonableError):
code = ErrorCode.BAD_EVENT_QUEUE_ID
data_fields = ['queue_id']
def __init__(self, queue_id):
# type: (Text) -> None
self.queue_id = queue_id # type: Text
@staticmethod
def msg_format():
# type: () -> Text
return _("Bad event queue id: {queue_id}")