fix: диагностика ошибок прав доступа и некорректного адреса при запуске#924
Open
f4rceful wants to merge 1 commit into
Open
fix: диагностика ошибок прав доступа и некорректного адреса при запуске#924f4rceful wants to merge 1 commit into
f4rceful wants to merge 1 commit into
Conversation
Startup crash handlers guided users only on "port already in use", leaving permission-denied (Flowseal#878, Errno 13 / WSAEACCES) and invalid-address (Flowseal#903, WinError 10014) bind failures with no actionable message. Add a dependency-free diagnose_listen_error() classifier that maps bind OSErrors to user-facing guidance (port busy / permission / bad address), and wire it into the Windows/Linux tray and macOS crash handlers (which previously also disagreed on which errors to catch).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Что сделано
diagnose_listen_error()вutils/diagnostics.py, который сопоставляетOSErrorпривязки сокета с понятными пользователю сообщениями: порт занят, доступ запрещён или некорректный/недоступный адрес.utils/tray_common.py(трей Windows/Linux) иmacos.py(macOS), — поэтому ошибки помимо «порт занят» теперь показывают подсказку, а не приводят к молчаливому падению.Зачем
Раньше обработчики падений распознавали только «порт уже используется». Другие частые ошибки привязки оставались без диагностики:
Errno 13/ WSAEACCES10013)WinError 10014/ WSAEFAULT)Классификатор покрывает POSIX-коды
errnoи WinSock-коды Windows (10013/10014/10048/10049) и возвращаетNoneдля несвязанных ошибок, чтобы вызывающий код сохранял прежнюю общую обработку.Как проверить
py_compileдляutils/diagnostics.py,utils/tray_common.py,macos.py— без ошибок.