mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-14 14:17:08 +00:00
fix: report a malformed Redis URL instead of raising from urlsplit
urlsplit raises ValueError on input such as redis://[::1 , which nothing converted, so a typo left native setup with a traceback rather than the message every other unusable URL gets.
This commit is contained in:
1 parent
65ee2f4201
commit
c8ab1cbab2
2 files changed
+21
-1
No files matched your search
@@ -209,7 +209,11 @@ def _redis_urls(base: str) -> dict[str, str]:
|
||||
Everything else in the URL is kept — TLS, credentials, and query parameters such as the
|
||||
``ssl_cert_reqs`` that a rediss:// endpoint usually needs.
|
||||
"""
|
||||
parts = urlsplit(base)
|
||||
try:
|
||||
parts = urlsplit(base)
|
||||
except ValueError as exc:
|
||||
# urlsplit raises on things like redis://[::1 ; that is a typo, not a crash.
|
||||
raise DeployError(f"the Redis URL {base!r} could not be read: {exc}") from exc
|
||||
if parts.scheme not in ("redis", "rediss"):
|
||||
raise DeployError(
|
||||
f"the Redis URL {base!r} should start with redis:// or rediss://, with any options as "
|
||||
|
||||
Reference in new issue
Block a user