Skip to content

Commit

Permalink
Add ConnectionError and general Exception clauses to `ProjectSetupW…
Browse files Browse the repository at this point in the history
…izard` (#1412)
  • Loading branch information
mrvisscher authored Nov 26, 2024
1 parent f2a6fdb commit 023eb5a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion activity_browser/ui/wizards/project_setup_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ def validatePage(self):
release = ei.EcoinventRelease(settings)
release.list_versions()

# logon was unsuccesful
except requests.exceptions.HTTPError as e:
QtWidgets.QApplication.restoreOverrideCursor()

Expand All @@ -161,6 +160,16 @@ def validatePage(self):
self.message.setText("Unknown connection error, try again later.")
raise e

except requests.exceptions.ConnectionError:
QtWidgets.QApplication.restoreOverrideCursor()
self.message.setText("Cannot connect to the internet, please try again later.")
return False

except Exception as e:
# restore cursor on all exceptions
QtWidgets.QApplication.restoreOverrideCursor()
raise e

# in case of success, set the settings for permanent use
ei.permanent_setting("username", self.username.text())
ei.permanent_setting("password", self.password.text())
Expand Down

0 comments on commit 023eb5a

Please sign in to comment.