Conversation
| ); | ||
|
|
||
| public static readonly errorCodes = toHelpSection('ERROR CODES', { | ||
| 'Succeeded (0)': 'Preview session ended successfully and traces saved.', |
There was a problem hiding this comment.
NIT: Why (0)Succeeded would be an error code? Perhaps the variable should be called EXIT CODES?
There was a problem hiding this comment.
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
src/commands/agent/preview/end.ts
Outdated
| } | ||
|
|
||
| const tracesPath = await agent.getHistoryDir(); | ||
| await removeCache(agent); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Shouldn't this have errorCode=4?
There was a problem hiding this comment.
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; |
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@