Skip to content
Open
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
10 changes: 9 additions & 1 deletion src/algokit/cli/project/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
logger = logging.getLogger(__name__)


def _format_deploy_error(result: proc.RunResult) -> str:
msg = f"Deployment command exited with error code = {result.exit_code}"
command_output = result.output.strip()
if command_output:
msg = f"{msg}\n\nCommand output:\n{command_output}"
return msg


def _ensure_aliases(
config_env: dict[str, str],
deployer_alias: str | None = None,
Expand Down Expand Up @@ -129,7 +137,7 @@ def _execute_deploy_command( # noqa: PLR0913
) from ex
else:
if result.exit_code != 0:
raise click.ClickException(f"Deployment command exited with error code = {result.exit_code}")
raise click.ClickException(_format_deploy_error(result))


class _CommandParamType(click.types.StringParamType):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ Deploying smart contracts from AlgoKit compliant repository 🚀
DEBUG: Running '/bin/gm' in '{current_working_directory}'
/bin/gm: it is not morning
Error: Deployment command exited with error code = -1

Command output:
it is not morning