Skip to content

Commit

Permalink
show a more friendly error when a server that is not compatible with …
Browse files Browse the repository at this point in the history
…gevent-socketio is used
  • Loading branch information
miguelgrinberg committed Apr 27, 2014
1 parent 9300885 commit a58879f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions flask_socketio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ def __init__(self, app, socket):
def __call__(self, environ, start_response):
path = environ['PATH_INFO'].strip('/')
if path is not None and path.startswith('socket.io'):
if 'socketio' not in environ:
raise RuntimeError('You need to use a gevent-socketio server.')
socketio_manage(environ, self.socket.get_namespaces(), self.app,
json_loads=json.loads, json_dumps=json.dumps)
else:
Expand Down

0 comments on commit a58879f

Please sign in to comment.