Skip to content

Commit

Permalink
improve error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
shadeofblue committed Dec 22, 2021
1 parent 1de9c6d commit 1259892
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion goth/assertions/assertions.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ async def func_wrapper():
try:
return await self._func(self)
except asyncio.CancelledError:
raise AssertionError("Assertion cancelled")
raise AssertionError(f"Assertion cancelled: {self}")
finally:
self._notify_update_events()

Expand Down
4 changes: 3 additions & 1 deletion goth/runner/probe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import logging
import os
from pathlib import Path
import traceback
from typing import (
AsyncIterator,
Dict,
Expand Down Expand Up @@ -394,9 +395,10 @@ async def run_command_on_host(
logger.debug("Command task has finished")

except Exception as e:
logger.error(f"Cancelling command on error: {e!r}")
logger.error(f"Cancelling command on error: {e!r}, command: `{command}`")
if cmd_task and not cmd_task.done():
cmd_task.cancel()
traceback.print_exc()
raise

finally:
Expand Down

0 comments on commit 1259892

Please sign in to comment.