Skip to content

Commit

Permalink
Feat: More informative exception message in lean logs command (#489)
Browse files Browse the repository at this point in the history
* feat: more informative excpetion message in `lean logs` command

* refactor: change error message more appropriate
  • Loading branch information
Romazes authored Aug 15, 2024
1 parent 5848527 commit 51968f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lean/commands/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 '<Project_path>'.")

print(most_recent_file.read_text(encoding="utf-8").strip())

0 comments on commit 51968f6

Please sign in to comment.