mirror of
https://github.com/Flowseal/tg-ws-proxy.git
synced 2026-06-23 23:11:08 +03:00
fix: diagnose permission and bad-address bind failures on startup (#924)
This commit is contained in:
committed by
GitHub
parent
21fe672963
commit
784a7f659b
@@ -32,6 +32,7 @@ from utils.tray_common import (
|
||||
LOG_FILE, acquire_lock, apply_proxy_config, ensure_dirs, load_config,
|
||||
log, release_lock, save_config, setup_logging, stop_proxy, tg_proxy_url,
|
||||
)
|
||||
from utils.diagnostics import diagnose_listen_error
|
||||
|
||||
MENUBAR_ICON_PATH = APP_DIR / "menubar_icon.png"
|
||||
|
||||
@@ -184,13 +185,9 @@ def _run_proxy_thread() -> None:
|
||||
loop.run_until_complete(_run(stop_event=stop_ev))
|
||||
except Exception as exc:
|
||||
log.error("Proxy thread crashed: %s", exc)
|
||||
if "Address already in use" in str(exc):
|
||||
_show_error(
|
||||
"Не удалось запустить прокси:\n"
|
||||
"Порт уже используется другим приложением.\n\n"
|
||||
"Закройте приложение, использующее этот порт, "
|
||||
"или измените порт в настройках прокси и перезапустите."
|
||||
)
|
||||
msg = diagnose_listen_error(exc)
|
||||
if msg:
|
||||
_show_error(msg)
|
||||
finally:
|
||||
loop.close()
|
||||
_async_stop = None
|
||||
|
||||
Reference in New Issue
Block a user