diff --git a/zerver/tornado/event_queue.py b/zerver/tornado/event_queue.py index 18c75f3ad1..f95cd21b6c 100644 --- a/zerver/tornado/event_queue.py +++ b/zerver/tornado/event_queue.py @@ -573,10 +573,19 @@ def request_event_queue(user_profile, user_client, apply_markdown, 'lifespan_secs': queue_lifespan_secs} if event_types is not None: req['event_types'] = ujson.dumps(event_types) - resp = requests_client.get(settings.TORNADO_SERVER + '/api/v1/events', - auth=requests.auth.HTTPBasicAuth( - user_profile.email, user_profile.api_key), - params=req) + + try: + resp = requests_client.get(settings.TORNADO_SERVER + '/api/v1/events', + auth=requests.auth.HTTPBasicAuth( + user_profile.email, user_profile.api_key), + params=req) + except requests.adapters.ConnectionError: + logging.error('Tornado server does not seem to be running, check %s ' + 'and %s for more information.' % + (settings.ERROR_FILE_LOG_PATH, "tornado.log")) + raise requests.adapters.ConnectionError( + "Django cannot connect to Tornado server (%s); try restarting" % + (settings.TORNADO_SERVER)) resp.raise_for_status()