Skip to content

Wr/exit codes @W-21513440@#378

Open
WillieRuemmele wants to merge 7 commits intomainfrom
wr/exitCodes
Open

Wr/exit codes @W-21513440@#378
WillieRuemmele wants to merge 7 commits intomainfrom
wr/exitCodes

Conversation

@WillieRuemmele
Copy link
Copy Markdown
Contributor

What does this PR do?

unifies and designates error codes based on error causes
updates help to have nice section on exit codes

What issues does this PR fix or reference?

@W-21513440@

@WillieRuemmele WillieRuemmele requested a review from a team as a code owner March 27, 2026 15:58
);

public static readonly errorCodes = toHelpSection('ERROR CODES', {
'Succeeded (0)': 'Preview session ended successfully and traces saved.',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: Why (0)Succeeded would be an error code? Perhaps the variable should be called EXIT CODES?

Copy link
Copy Markdown
Contributor Author

@WillieRuemmele WillieRuemmele Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it creates a nice section in the --help output:

ERROR CODES
  Succeeded (0)          The deploy succeeded.
  Canceled (1)           The deploy was canceled.

I was following project deploy start ^ which lists 0

I see how it doesn't make sense for error codes

}

const tracesPath = await agent.getHistoryDir();
await removeCache(agent);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't removeCache() be called after agent.preview.end()? If agent.preview.end() fails to call the session then is not possible to try to close it again since it was removed from cache.

);
}
await Lifecycle.getInstance().emitTelemetry({ eventName: 'agent_activate_get_agent_failed' });
throw wrapped;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this have errorCode=4?

Copy link
Copy Markdown
Contributor Author

@WillieRuemmele WillieRuemmele Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 => not found error, meaning getAgentForActivation threw an error
4 => API error, agent.activate(version); threw an error


  - Exit 0: Success
  - Exit 1: Compilation/validation/execution errors (business logic failures)
  - Exit 2: Not found (agent, session, file, API 404)
  - Exit 3: Server error (API 500)
  - Exit 4: Operation failed (API/network errors during operations) ← Your question
  - Exit 5: Ambiguous (multiple resources match, need clarification)

they should follow this

);
}
await Lifecycle.getInstance().emitTelemetry({ eventName: 'agent_deactivate_get_agent_failed' });
throw wrapped;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

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.

3 participants