diff --git a/LunaTranslator/LunaTranslator/translator/gemini.py b/LunaTranslator/LunaTranslator/translator/gemini.py index f67d8b11..032a48d7 100644 --- a/LunaTranslator/LunaTranslator/translator/gemini.py +++ b/LunaTranslator/LunaTranslator/translator/gemini.py @@ -54,7 +54,11 @@ class TS(basetrans): ], }, verify=False, - ).json() + ) + try: + res = res.json() + except: + raise Exception(res.text) try: line = res["candidates"][0]["content"]["parts"][0]["text"] return line