diff options
author | Miguel Jacq <mig@mig5.net> | 2023-05-31 15:38:52 +1000 |
---|---|---|
committer | Miguel Jacq <mig@mig5.net> | 2023-05-31 15:38:52 +1000 |
commit | 4439838ee7d115e9a3f7eda212fb053649b44319 (patch) | |
tree | c336627834865723382b63dcb0813bb7954f91a8 /desktop/onionshare/gui_common.py | |
parent | dd55e78d6345061ae9317231b9d831132636f1fc (diff) | |
download | onionshare-4439838ee7d115e9a3f7eda212fb053649b44319.tar.gz onionshare-4439838ee7d115e9a3f7eda212fb053649b44319.zip |
Raise a Waitress exception into the UI with a modal dialog and reset the share if it occurs
Diffstat (limited to 'desktop/onionshare/gui_common.py')
-rw-r--r-- | desktop/onionshare/gui_common.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/desktop/onionshare/gui_common.py b/desktop/onionshare/gui_common.py index bb7e1f1b..e3d712f5 100644 --- a/desktop/onionshare/gui_common.py +++ b/desktop/onionshare/gui_common.py @@ -41,7 +41,7 @@ from onionshare_cli.onion import ( PortNotAvailable, ) from onionshare_cli.meek import Meek - +from onionshare_cli.web.web import WaitressException class GuiCommon: """ @@ -581,6 +581,13 @@ class GuiCommon: return strings._("error_port_not_available") return None + @staticmethod + def get_translated_web_error(e): + """ + Takes an exception defined in web.py and returns a translated error message + """ + if type(e) is WaitressException: + return strings._("waitress_web_server_error") class ToggleCheckbox(QtWidgets.QCheckBox): def __init__(self, text): |