Skip to content

Commit

Permalink
Merge pull request #518 from sumesh-aot/jwt
Browse files Browse the repository at this point in the history
Adding a handler for socket error.
  • Loading branch information
gil0109 authored Feb 22, 2021
2 parents 8e42b04 + a02e408 commit 3e9ee11
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api/app/resources/theq/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from app.auth.auth import jwt
from app.models.theq import CSR, Office
from qsystem import socketio, my_print
from flask_jwt_oidc.exceptions import AuthError


@socketio.on('joinRoom')
Expand Down Expand Up @@ -72,3 +73,9 @@ def clear_csr_user_id(csr_id):
@socketio.on('sync_offices_cache')
def sync_offices_cache():
Office.clear_offices_cache()


@socketio.on_error()
def error_handler(e):
# Passing the execution as it would be an auth error with invalid token.
print('Socket error ', e)

0 comments on commit 3e9ee11

Please sign in to comment.