mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2025-07-04 20:25:25 +02:00
Move error handling to utils
This commit is contained in:
@ -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()
|
Reference in New Issue
Block a user