diff options
author | Henrique Joaquim <h.joaquim@campus.fct.unl.pt> | 2023-09-20 19:11:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-20 19:11:24 +0100 |
commit | 4851da1945470a61df2db5c30ef2ec8471876da9 (patch) | |
tree | 5adf93499e5e2530647ac0a785962799d741b9a9 | |
parent | d60befa328abe927e0c5d8fb7bce8a494f8a8056 (diff) |
add try except on metadata computing (#5456)
-rw-r--r-- | openbb_sdk/sdk/core/openbb_core/app/command_runner.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/openbb_sdk/sdk/core/openbb_core/app/command_runner.py b/openbb_sdk/sdk/core/openbb_core/app/command_runner.py index 17cd48b69ec..228f432accb 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/command_runner.py +++ b/openbb_sdk/sdk/core/openbb_core/app/command_runner.py @@ -367,12 +367,16 @@ class StaticCommandRunner: duration = perf_counter_ns() - start_ns if execution_context.user_settings.preferences.metadata: - obbject.metadata = Metadata( - arguments=kwargs, - duration=duration, - route=route, - timestamp=timestamp, - ) + try: + obbject.metadata = Metadata( + arguments=kwargs, + duration=duration, + route=route, + timestamp=timestamp, + ) + except Exception as e: + if Env().DEBUG_MODE: + raise OpenBBError(e) from e return obbject |