mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-11-15 02:21:21 +01:00
Move error handling to utils
This commit is contained in:
parent
2d81c923a9
commit
1d085d328b
@ -11,9 +11,6 @@ class Gateway(Namespace):
|
||||
db.session.commit()
|
||||
db.session.remove()
|
||||
|
||||
def on_error(self):
|
||||
disconnect()
|
||||
|
||||
def on_connect(self):
|
||||
emit('hello')
|
||||
|
||||
|
@ -2,7 +2,7 @@ from titanembeds.database import db, Guilds, UnauthenticatedUsers, Unauthenticat
|
||||
from titanembeds.constants import LANGUAGES
|
||||
from flask import request, session
|
||||
from flask_limiter import Limiter
|
||||
from flask_socketio import SocketIO
|
||||
from flask_socketio import SocketIO, disconnect
|
||||
from flask_babel import Babel
|
||||
from flask_redis import FlaskRedis
|
||||
from config import config
|
||||
@ -324,4 +324,8 @@ def language_code_list():
|
||||
|
||||
rate_limiter = Limiter(key_func=get_client_ipaddr) # Default limit by ip address
|
||||
socketio = SocketIO()
|
||||
babel = Babel()
|
||||
babel = Babel()
|
||||
|
||||
@socketio.on_error_default # disconnect on all errors
|
||||
def default_socketio_error_handler(e):
|
||||
disconnect()
|
Loading…
Reference in New Issue
Block a user