diff options
author | Saptak Sengupta <saptak013@gmail.com> | 2023-06-06 13:01:24 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-06 13:01:24 +0530 |
commit | f3fec65ef4c91f1225328da5f682c3ba8ea5f0ba (patch) | |
tree | 5e6be2c1d0313efb9ba8244b8546645a23132fdb /desktop/onionshare/gui_common.py | |
parent | efaa5105e731fc7f8dd41162f7bee0e787ca2b16 (diff) | |
parent | d6c732e20c5dac738462eb438272bfc053d844ce (diff) | |
download | onionshare-f3fec65ef4c91f1225328da5f682c3ba8ea5f0ba.tar.gz onionshare-f3fec65ef4c91f1225328da5f682c3ba8ea5f0ba.zip |
Merge pull request #1677 from onionshare/update-deps
Update deps & switch to waitress for running flask servers
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): |