Skip to content

Commit

Permalink
Update Webserver_chat_message_processor.py
Browse files Browse the repository at this point in the history
  • Loading branch information
BoQsc committed Aug 25, 2024
1 parent 670d83a commit 45bbc5a
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,17 @@
logging.basicConfig(filename='chat_processor_errors.log', level=logging.ERROR,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')


import sys
# Global exception handler
def handle_exception(exc_type, exc_value, exc_traceback):
if issubclass(exc_type, KeyboardInterrupt):
sys.__excepthook__(exc_type, exc_value, exc_traceback)
return
# Log the exception
logging.error("Uncaught exception", exc_info=(exc_type, exc_value, exc_traceback))

# Set the global exception hook
sys.excepthook = handle_exception

def datetime_to_string(obj):
if isinstance(obj, datetime):
Expand Down

0 comments on commit 45bbc5a

Please sign in to comment.