mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-13 10:15:21 +00:00
fix: doctor reports a bad DOCSGPT_PORT instead of raising on it
_port_number was written so a hand-edited .env could not reach int() raw, and then doctor did exactly that: a nonnumeric port ended the command with a traceback rather than the message, in the one command whose job is to explain a broken setup.
This commit is contained in:
1 parent
731baa7d31
commit
bcf2707efa
2 files changed
+14
-1
No files matched your search
@@ -862,7 +862,9 @@ def doctor(args, context: Optional[Context] = None) -> int:
|
||||
_check_provider(env),
|
||||
]
|
||||
|
||||
port = int(env.get("DOCSGPT_PORT") or stack.DEFAULT_PORT)
|
||||
# The one command that exists to explain a broken setup must not fall over on one.
|
||||
port = _port_number(env["DOCSGPT_PORT"], f"DOCSGPT_PORT in {env_path}") if env.get("DOCSGPT_PORT") \
|
||||
else stack.DEFAULT_PORT
|
||||
if _port_is_free(port):
|
||||
checks.append(Check("port", "ok", f"{port} is free"))
|
||||
else:
|
||||
|
||||
Reference in new issue
Block a user