mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 20:13:46 +00:00 
			
		
		
		
	event_queue: Improve error message for ConnectionError exception
Improve error message for "ConnectionError: HTTPConnectionPool(host='localhost', port=9993): Max retries exceeded" exception. Fixes #215.
This commit is contained in:
		| @@ -573,10 +573,19 @@ def request_event_queue(user_profile, user_client, apply_markdown, | |||||||
|                'lifespan_secs': queue_lifespan_secs} |                'lifespan_secs': queue_lifespan_secs} | ||||||
|         if event_types is not None: |         if event_types is not None: | ||||||
|             req['event_types'] = ujson.dumps(event_types) |             req['event_types'] = ujson.dumps(event_types) | ||||||
|         resp = requests_client.get(settings.TORNADO_SERVER + '/api/v1/events', |  | ||||||
|                                    auth=requests.auth.HTTPBasicAuth( |         try: | ||||||
|                                        user_profile.email, user_profile.api_key), |             resp = requests_client.get(settings.TORNADO_SERVER + '/api/v1/events', | ||||||
|                                    params=req) |                                        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() |         resp.raise_for_status() | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user