feat : better logging

This commit is contained in:
martin legrand
2025-03-29 13:14:37 +01:00
parent 4712d39427
commit 7e95498f7a
2 changed files with 5 additions and 12 deletions
+3 -3
View File
@@ -120,14 +120,14 @@ class Provider:
is_complete = False
while not is_complete:
response = requests.get(f"http://{self.server_ip}/get_updated_sentence")
print("raw response", response.json())
if "error" in response.json():
continue
pretty_print(response.json()["error"], color="failure")
break
thought = response.json()["sentence"]
is_complete = bool(response.json()["is_complete"])
time.sleep(2)
except KeyError as e:
raise Exception(f"{str(e)}\n\nError occured with server route. Are you using the correct address for the config.ini provider?") from e
raise Exception(f"{str(e)}\nError occured with server route. Are you using the correct address for the config.ini provider?") from e
except Exception as e:
raise e
return thought