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 84d7aa4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions goth/assertions/assertions.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class EventStream(Protocol, AsyncIterable[E]):
events_ended: bool
"""`True` iff there will be no more events."""


else:

EventStream = AsyncIterable
Expand Down Expand Up @@ -152,7 +151,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
5 changes: 4 additions & 1 deletion goth/runner/probe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,12 @@ 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()
import traceback

traceback.print_exc()
raise

finally:
Expand Down

0 comments on commit 84d7aa4

Please sign in to comment.