django-websocket-redis icon indicating copy to clipboard operation
django-websocket-redis copied to clipboard

Catch the WebSocketError when closing the connection by the client

Open Airboy opened this issue 6 years ago • 1 comments

Is there a way to catch the WebSocketError when the client (frontend) explicitly closes the connection? Currently, I have the following errors in my logs:

[uwsgi] WebSocketError: unable to receive websocket message
| Traceback (most recent call last):
|   File "/var/www/lib/python3.5/site-packages/ws4redis/uwsgi_runserver.py", line 28, in receive
|     return uwsgi.websocket_recv_nb()
| OSError: unable to receive websocket message
|
| During handling of the above exception, another exception occurred:
|
| Traceback (most recent call last):
|   File "/var/www/lib/python3.5/site-packages/ws4redis/wsgi_server.py", line 123, in __call__
|     recvmsg = RedisMessage(websocket.receive())
|   File "/var/www/lib/python3.5/site-packages/ws4redis/uwsgi_runserver.py", line 31, in receive
|     raise WebSocketError(e)
| ws4redis.exceptions.WebSocketError: unable to receive websocket message
| [uwsgi] WebSocketError: unable to receive websocket message
| Traceback (most recent call last):
|   File "/var/www/lib/python3.5/site-packages/ws4redis/uwsgi_runserver.py", line 28, in receive
|     return uwsgi.websocket_recv_nb()
| OSError: unable to receive websocket message

It's not critical but it should be better to catch this specific error.

Airboy avatar Mar 02 '18 23:03 Airboy

have you solved this problem???

ghost avatar Aug 02 '18 08:08 ghost