diff options
author | Diogo Sousa <montezdesousa@gmail.com> | 2024-05-21 23:43:14 +0100 |
---|---|---|
committer | Diogo Sousa <montezdesousa@gmail.com> | 2024-05-21 23:43:14 +0100 |
commit | 2ce858efbd945fced661f03963f60ac54bb5e021 (patch) | |
tree | 8770d156956f4dd6c803c6ab92224e925a5debde | |
parent | 61d2043e85a7fc0423be03eb8555bac23a7d0be2 (diff) |
fix: error messages
-rw-r--r-- | openbb_platform/core/openbb_core/app/static/container.py | 2 | ||||
-rw-r--r-- | openbb_platform/core/openbb_core/app/static/utils/decorators.py | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/openbb_platform/core/openbb_core/app/static/container.py b/openbb_platform/core/openbb_core/app/static/container.py index 520fb68cdd6..c6fcf759a42 100644 --- a/openbb_platform/core/openbb_core/app/static/container.py +++ b/openbb_platform/core/openbb_core/app/static/container.py @@ -67,6 +67,6 @@ class Container: if self._check_credentials(p): return p raise OpenBBError( - f"Please specify the provider. Fallback failed, tried -> {', '.join(providers)}." + f"Fallback failed due to missing credentials, please specify the provider. Tried: {', '.join(providers)}." ) return choice diff --git a/openbb_platform/core/openbb_core/app/static/utils/decorators.py b/openbb_platform/core/openbb_core/app/static/utils/decorators.py index 6155e932147..d82f90d5a6b 100644 --- a/openbb_platform/core/openbb_core/app/static/utils/decorators.py +++ b/openbb_platform/core/openbb_core/app/static/utils/decorators.py @@ -73,8 +73,12 @@ def exception_handler(func: Callable[P, R]) -> Callable[P, R]: ) ] ) - _input = err.get("input", "") msg = err.get("msg", "") + _input = ( + "..." + if msg == "Missing required argument" + else err.get("input", "") + ) error_list.append(f"[Arg] {loc} -> input: {_input} -> {msg}") error_list.insert(0, validation_error) error_str = "\n".join(error_list) |