Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLipu Fei <lipu.fei815@gmail.com>2019-02-18 15:52:27 +0300
committerLipu Fei <lipu.fei815@gmail.com>2019-02-18 15:52:27 +0300
commit64150cc7cf4625810845990b50c7d450e2630c69 (patch)
treee0078b683f9a20e168b94c30fd98ba841acf4cde /plugins/CuraDrive
parent8d263e11b1aa16d0eda2f6f429b36b74c560eaf3 (diff)
parent0cfc258b8d64499e1c8d8961f9929afb14d7c988 (diff)
Merge remote-tracking branch 'origin/4.0'
Diffstat (limited to 'plugins/CuraDrive')
-rw-r--r--plugins/CuraDrive/src/DriveApiService.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/plugins/CuraDrive/src/DriveApiService.py b/plugins/CuraDrive/src/DriveApiService.py
index 7c1f8faa83..6a828e32d6 100644
--- a/plugins/CuraDrive/src/DriveApiService.py
+++ b/plugins/CuraDrive/src/DriveApiService.py
@@ -40,10 +40,13 @@ class DriveApiService:
if not access_token:
Logger.log("w", "Could not get access token.")
return []
-
- backup_list_request = requests.get(self.BACKUP_URL, headers = {
- "Authorization": "Bearer {}".format(access_token)
- })
+ try:
+ backup_list_request = requests.get(self.BACKUP_URL, headers = {
+ "Authorization": "Bearer {}".format(access_token)
+ })
+ except requests.exceptions.ConnectionError:
+ Logger.log("w", "Unable to connect with the server.")
+ return []
# HTTP status 300s mean redirection. 400s and 500s are errors.
# Technically 300s are not errors, but the use case here relies on "requests" to handle redirects automatically.