mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
fix(cli): preserve runtime recovery steps (#24800)
Co-authored-by: Neil <4138956+nwparker@users.noreply.github.com>
This commit is contained in:
+10
-2
@@ -76,7 +76,7 @@ export function formatCliError(error: unknown, context: CliErrorContext = {}): s
|
||||
if (hasOrchestrationRequestId(error.data)) {
|
||||
return message
|
||||
}
|
||||
return `${message}\nOrca is not running. Run 'orca open' first.`
|
||||
return formatRuntimeUnavailableError(message, error.data)
|
||||
}
|
||||
// Match before generic recovery; flattened errors may retain only the conflict token.
|
||||
const conflict = automationOwnerConflictRecovery(matchAutomationOwnerConflict(error))
|
||||
@@ -103,7 +103,7 @@ export function formatCliError(error: unknown, context: CliErrorContext = {}): s
|
||||
error instanceof RuntimeRpcFailureError &&
|
||||
error.response.error.code === 'runtime_unavailable'
|
||||
) {
|
||||
return `${message}\nOrca is not running. Run 'orca open' first.`
|
||||
return formatRuntimeUnavailableError(message, error.response.error.data)
|
||||
}
|
||||
if (error instanceof RuntimeRpcFailureError) {
|
||||
return formatMessageWithNextSteps(message, nextStepsFromData(error.response.error.data))
|
||||
@@ -119,6 +119,14 @@ function hasOrchestrationRequestId(data: unknown): boolean {
|
||||
)
|
||||
}
|
||||
|
||||
function formatRuntimeUnavailableError(message: string, data: unknown): string {
|
||||
const nextSteps = nextStepsFromData(data)
|
||||
if (nextSteps.length > 0) {
|
||||
return formatMessageWithNextSteps(message, nextSteps)
|
||||
}
|
||||
return `${message}\nOrca is not running. Run 'orca open' first.`
|
||||
}
|
||||
|
||||
export function reportCliError(error: unknown, json: boolean, context: CliErrorContext = {}): void {
|
||||
const selector = contextRecovery(errorCode(error), context)
|
||||
if (json) {
|
||||
|
||||
Reference in New Issue
Block a user