[Fix] Error Handling: Improve network disconnection handling and enhance logging mechanisms.

This commit is contained in:
misyaguziya
2025-12-29 16:27:27 +09:00
parent 063b79477f
commit bf1c0236b5

View File

@@ -1643,8 +1643,8 @@ class Controller:
self.run(200, self.run_mapping["selectable_plamo_model_list"], config.SELECTABLE_PLAMO_MODEL_LIST) self.run(200, self.run_mapping["selectable_plamo_model_list"], config.SELECTABLE_PLAMO_MODEL_LIST)
if config.SELECTED_PLAMO_MODEL not in config.SELECTABLE_PLAMO_MODEL_LIST: if config.SELECTED_PLAMO_MODEL not in config.SELECTABLE_PLAMO_MODEL_LIST:
config.SELECTED_PLAMO_MODEL = config.SELECTABLE_PLAMO_MODEL_LIST[0] config.SELECTED_PLAMO_MODEL = config.SELECTABLE_PLAMO_MODEL_LIST[0]
model.setTranslatorPlamoModel(model=config.SELECTED_PLAMO_MODEL) model.setTranslatorPlamoModel(model=config.SELECTED_PLAMO_MODEL)
self.run(200, self.run_mapping["selected_plamo_model"], config.SELECTED_PLAMO_MODEL) self.run(200, self.run_mapping["selected_plamo_model"], config.SELECTED_PLAMO_MODEL)
model.updateTranslatorPlamoClient() model.updateTranslatorPlamoClient()
self.updateTranslationEngineAndEngineList() self.updateTranslationEngineAndEngineList()
response = {"status":200, "result":config.AUTH_KEYS[translator_name]} response = {"status":200, "result":config.AUTH_KEYS[translator_name]}
@@ -1755,8 +1755,8 @@ class Controller:
self.run(200, self.run_mapping["selectable_gemini_model_list"], config.SELECTABLE_GEMINI_MODEL_LIST) self.run(200, self.run_mapping["selectable_gemini_model_list"], config.SELECTABLE_GEMINI_MODEL_LIST)
if config.SELECTED_GEMINI_MODEL not in config.SELECTABLE_GEMINI_MODEL_LIST: if config.SELECTED_GEMINI_MODEL not in config.SELECTABLE_GEMINI_MODEL_LIST:
config.SELECTED_GEMINI_MODEL = config.SELECTABLE_GEMINI_MODEL_LIST[0] config.SELECTED_GEMINI_MODEL = config.SELECTABLE_GEMINI_MODEL_LIST[0]
model.setTranslatorGeminiModel(model=config.SELECTED_GEMINI_MODEL) model.setTranslatorGeminiModel(model=config.SELECTED_GEMINI_MODEL)
self.run(200, self.run_mapping["selected_gemini_model"], config.SELECTED_GEMINI_MODEL) self.run(200, self.run_mapping["selected_gemini_model"], config.SELECTED_GEMINI_MODEL)
model.updateTranslatorGeminiClient() model.updateTranslatorGeminiClient()
self.updateTranslationEngineAndEngineList() self.updateTranslationEngineAndEngineList()
response = {"status":200, "result":config.AUTH_KEYS[translator_name]} response = {"status":200, "result":config.AUTH_KEYS[translator_name]}
@@ -1868,8 +1868,8 @@ class Controller:
self.run(200, self.run_mapping["selectable_openai_model_list"], config.SELECTABLE_OPENAI_MODEL_LIST) self.run(200, self.run_mapping["selectable_openai_model_list"], config.SELECTABLE_OPENAI_MODEL_LIST)
if config.SELECTED_OPENAI_MODEL not in config.SELECTABLE_OPENAI_MODEL_LIST: if config.SELECTED_OPENAI_MODEL not in config.SELECTABLE_OPENAI_MODEL_LIST:
config.SELECTED_OPENAI_MODEL = config.SELECTABLE_OPENAI_MODEL_LIST[0] config.SELECTED_OPENAI_MODEL = config.SELECTABLE_OPENAI_MODEL_LIST[0]
model.setTranslatorOpenAIModel(model=config.SELECTED_OPENAI_MODEL) model.setTranslatorOpenAIModel(model=config.SELECTED_OPENAI_MODEL)
self.run(200, self.run_mapping["selected_openai_model"], config.SELECTED_OPENAI_MODEL) self.run(200, self.run_mapping["selected_openai_model"], config.SELECTED_OPENAI_MODEL)
model.updateTranslatorOpenAIClient() model.updateTranslatorOpenAIClient()
self.updateTranslationEngineAndEngineList() self.updateTranslationEngineAndEngineList()
response = {"status":200, "result":config.AUTH_KEYS[translator_name]} response = {"status":200, "result":config.AUTH_KEYS[translator_name]}
@@ -1981,8 +1981,8 @@ class Controller:
self.run(200, self.run_mapping["selectable_groq_model_list"], config.SELECTABLE_GROQ_MODEL_LIST) self.run(200, self.run_mapping["selectable_groq_model_list"], config.SELECTABLE_GROQ_MODEL_LIST)
if config.SELECTED_GROQ_MODEL not in config.SELECTABLE_GROQ_MODEL_LIST: if config.SELECTED_GROQ_MODEL not in config.SELECTABLE_GROQ_MODEL_LIST:
config.SELECTED_GROQ_MODEL = config.SELECTABLE_GROQ_MODEL_LIST[0] config.SELECTED_GROQ_MODEL = config.SELECTABLE_GROQ_MODEL_LIST[0]
model.setTranslatorGroqModel(model=config.SELECTED_GROQ_MODEL) model.setTranslatorGroqModel(model=config.SELECTED_GROQ_MODEL)
self.run(200, self.run_mapping["selected_groq_model"], config.SELECTED_GROQ_MODEL) self.run(200, self.run_mapping["selected_groq_model"], config.SELECTED_GROQ_MODEL)
model.updateTranslatorGroqClient() model.updateTranslatorGroqClient()
self.updateTranslationEngineAndEngineList() self.updateTranslationEngineAndEngineList()
response = {"status":200, "result":config.AUTH_KEYS[translator_name]} response = {"status":200, "result":config.AUTH_KEYS[translator_name]}
@@ -2094,8 +2094,8 @@ class Controller:
self.run(200, self.run_mapping["selectable_openrouter_model_list"], config.SELECTABLE_OPENROUTER_MODEL_LIST) self.run(200, self.run_mapping["selectable_openrouter_model_list"], config.SELECTABLE_OPENROUTER_MODEL_LIST)
if config.SELECTED_OPENROUTER_MODEL not in config.SELECTABLE_OPENROUTER_MODEL_LIST: if config.SELECTED_OPENROUTER_MODEL not in config.SELECTABLE_OPENROUTER_MODEL_LIST:
config.SELECTED_OPENROUTER_MODEL = config.SELECTABLE_OPENROUTER_MODEL_LIST[0] config.SELECTED_OPENROUTER_MODEL = config.SELECTABLE_OPENROUTER_MODEL_LIST[0]
model.setTranslatorOpenRouterModel(model=config.SELECTED_OPENROUTER_MODEL) model.setTranslatorOpenRouterModel(model=config.SELECTED_OPENROUTER_MODEL)
self.run(200, self.run_mapping["selected_openrouter_model"], config.SELECTED_OPENROUTER_MODEL) self.run(200, self.run_mapping["selected_openrouter_model"], config.SELECTED_OPENROUTER_MODEL)
model.updateTranslatorOpenRouterClient() model.updateTranslatorOpenRouterClient()
self.updateTranslationEngineAndEngineList() self.updateTranslationEngineAndEngineList()
response = {"status":200, "result":config.AUTH_KEYS[translator_name]} response = {"status":200, "result":config.AUTH_KEYS[translator_name]}