👍️[Update] Main : error logのトレースバックの処理を集約

This commit is contained in:
misygauziya
2024-12-16 14:22:49 +09:00
parent 8a4721b61d
commit 030b8a9f01
5 changed files with 26 additions and 24 deletions

View File

@@ -334,6 +334,8 @@ class Main:
status = response.get("status", None)
result = response.get("result", None)
except Exception as e:
from utils import errorLogging
errorLogging(e)
result = str(e)
status = 500
return result, status
@@ -345,9 +347,8 @@ class Main:
endpoint, data = self.queue.get()
result, status = self.handleRequest(endpoint, data)
except Exception as e:
import traceback
with open('error.log', 'a') as f:
traceback.print_exc(file=f)
from utils import errorLogging
errorLogging(e)
result = str(e)
status = 500