Skip to content

Commit

Permalink
protect against empty log files
Browse files Browse the repository at this point in the history
  • Loading branch information
eacharles committed Sep 5, 2024
1 parent 20ee316 commit 168e641
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lsst/cmservice/handlers/script_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,9 @@ async def _get_diagnostic_message(
) -> str:
with open(log_url, encoding="utf-8") as fin:
lines = fin.readlines()
return lines[-1]
if lines:
return lines[-1]
return "Empty log file"

async def _write_script(
self,
Expand Down

0 comments on commit 168e641

Please sign in to comment.