added more logs in case of error
This commit is contained in:
parent
ba70cdac89
commit
6802b12abb
10
main.py
10
main.py
@ -208,7 +208,7 @@ class MapsBackground(QThread):
|
|||||||
self.log(f"Error while fetching map info: {e}")
|
self.log(f"Error while fetching map info: {e}")
|
||||||
return
|
return
|
||||||
if req.status_code != 200:
|
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
|
return
|
||||||
j = req.json()
|
j = req.json()
|
||||||
blob_location = j["blob_location"]
|
blob_location = j["blob_location"]
|
||||||
@ -250,10 +250,16 @@ class MapsBackground(QThread):
|
|||||||
map_data = {"name": map_name, "b64_data": b64_data}
|
map_data = {"name": map_name, "b64_data": b64_data}
|
||||||
try:
|
try:
|
||||||
req = requests.post(f"{API_BASE_URL}/maps", json=map_data)
|
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()
|
req.raise_for_status()
|
||||||
except Exception as e:
|
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
|
return
|
||||||
|
|
||||||
self.log("Upload successful")
|
self.log("Upload successful")
|
||||||
|
|
||||||
def all_servers_download(self) -> None:
|
def all_servers_download(self) -> None:
|
||||||
|
Loading…
Reference in New Issue
Block a user