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