Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve error reporting... #570

Merged
merged 1 commit into from
Dec 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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