Skip to content

[ultra-review] apify run exits 0 when the Actor fails #1190

Description

@l2ysho

Severity: HIGH
Location: src/commands/run.ts:449-454
Parent: #1188

Problem

The catch block wrapping execWithLog reads stderr but never sets process.exitCode or re-throws (only a TODO comment). The command framework's exitCode ||= 1 handler never fires because the error is swallowed here.

Impact

Any Actor that throws an unhandled exception or calls process.exit(1) makes the CLI exit with code 0. This silently breaks CI/shell chains like apify run && deploy.

Suggested fix

In the catch block, propagate the failure, e.g.:

process.exitCode = (err as ExecaError).exitCode ?? 1;

Generated by an ultra code review.

Metadata

Metadata

Assignees

Labels

t-buildersIssues owned by the Builders team.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions