mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-28 21:12:16 +00:00
[Enhancement] Improve provider fallback message (#6507)
* feat: improve fallback message * fix: non blocking request * timeout * fix: undo request --------- Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com>
This commit is contained in:
@@ -72,11 +72,8 @@ class Container:
|
||||
if result is False:
|
||||
tries.append((p, "missing credentials"))
|
||||
else:
|
||||
tries.append((p, "not found"))
|
||||
tries.append((p, f"not installed, please install openbb-{p}"))
|
||||
|
||||
msg = "\n ".join([f"* '{pair[0]}' -> {pair[1]}" for pair in tries])
|
||||
raise OpenBBError(
|
||||
f"Provider fallback failed, please specify one of the available providers or update credentials.\n"
|
||||
f"[Providers]\n {msg}"
|
||||
)
|
||||
raise OpenBBError(f"Provider fallback failed.\n" f"[Providers]\n {msg}")
|
||||
return choice
|
||||
|
||||
@@ -88,7 +88,7 @@ def test_container__check_credentials(container):
|
||||
("provider_1", "provider_2"),
|
||||
OpenBBError,
|
||||
escape(
|
||||
"Provider fallback failed, please specify one of the available providers or update credentials."
|
||||
"Provider fallback failed."
|
||||
"\n[Providers]\n * 'x' -> not found\n * 'y' -> not found\n * 'z' -> not found"
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user