From 51968f68a74da36ce6184c858e741d2d61082981 Mon Sep 17 00:00:00 2001 From: Roman Yavnikov <45608740+Romazes@users.noreply.github.com> Date: Thu, 15 Aug 2024 23:17:10 +0300 Subject: [PATCH] Feat: More informative exception message in `lean logs` command (#489) * feat: more informative excpetion message in `lean logs` command * refactor: change error message more appropriate --- lean/commands/logs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lean/commands/logs.py b/lean/commands/logs.py index a4ccdf4b..240dc6c3 100644 --- a/lean/commands/logs.py +++ b/lean/commands/logs.py @@ -89,6 +89,7 @@ def logs(backtest: bool, live: bool, optimization: bool, project: Optional[Path] most_recent_timestamp = log_file_timestamp if most_recent_file is None: - raise RuntimeError(f"No {mode} log file exists") + raise RuntimeError(f"Unable to locate the {mode} log file, no recent run was found. " + "Please provide the '--project' argument, e.g., --project ''.") print(most_recent_file.read_text(encoding="utf-8").strip())