From 6802b12abb19376c1c74bcb5687f94f1fecb5304 Mon Sep 17 00:00:00 2001 From: Hipstercat Date: Thu, 23 Dec 2021 22:59:39 +0100 Subject: [PATCH] added more logs in case of error --- main.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 1dce7b2..729b180 100644 --- a/main.py +++ b/main.py @@ -208,7 +208,7 @@ class MapsBackground(QThread): self.log(f"Error while fetching map info: {e}") return if req.status_code != 200: - self.log(f"Could not download map from server, got status_code {req.status_code}") + self.log(f"Could not download map from server, got status_code {req.status_code}: {req.text}") return j = req.json() blob_location = j["blob_location"] @@ -250,10 +250,16 @@ class MapsBackground(QThread): map_data = {"name": map_name, "b64_data": b64_data} try: req = requests.post(f"{API_BASE_URL}/maps", json=map_data) + except Exception as e: + self.log(f"There was an error while uploading map: {e} {req.text}") + return + + try: req.raise_for_status() except Exception as e: - self.log(f"There was an error while uploading map: {e}") + self.log(f"There was an error while uploading map: {e} {req.text}") return + self.log("Upload successful") def all_servers_download(self) -> None: