Skip to content

fix: clarify actor not found error when ID is explicitly provided - #1337

Open
kuntal1461 wants to merge 1 commit into
apify:masterfrom
kuntal1461:fix/actor-context-error-message
Open

fix: clarify actor not found error when ID is explicitly provided#1337
kuntal1461 wants to merge 1 commit into
apify:masterfrom
kuntal1461:fix/actor-context-error-message

Conversation

@kuntal1461

Copy link
Copy Markdown

Closes #1147

What changed

  • Extracted formatActorContextError(reason, actorId) helper in resolve-actor-context.ts
  • When actorId is provided, error omits "run in an Actor directory / specify the Actor ID" suggestions and instead hints at token/permission access
  • When no actorId is provided, original fallback message is preserved
  • Applied to all four affected commands: actors info, builds create, builds ls, runs ls

Why

The old message suggested the user specify an Actor ID even when they already had — misleading when the real cause is a token with no access to an org Actor.

Test

  • Added unit tests for formatActorContextError in test/unit/lib/commands/resolve-actor-context.test.ts covering both the ID-provided and no-ID paths

Install size

No new dependencies added.

@kuntal1461
kuntal1461 force-pushed the fix/actor-context-error-message branch from a0081de to cc3bc54 Compare August 19, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve error message when Actor ID is provided but not found

2 participants