diff options
author | Lipu Fei <lipu.fei815@gmail.com> | 2019-02-18 15:52:27 +0300 |
---|---|---|
committer | Lipu Fei <lipu.fei815@gmail.com> | 2019-02-18 15:52:27 +0300 |
commit | 64150cc7cf4625810845990b50c7d450e2630c69 (patch) | |
tree | e0078b683f9a20e168b94c30fd98ba841acf4cde /plugins/CuraDrive | |
parent | 8d263e11b1aa16d0eda2f6f429b36b74c560eaf3 (diff) | |
parent | 0cfc258b8d64499e1c8d8961f9929afb14d7c988 (diff) |
Merge remote-tracking branch 'origin/4.0'
Diffstat (limited to 'plugins/CuraDrive')
-rw-r--r-- | plugins/CuraDrive/src/DriveApiService.py | 11 |
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. |