Skip to main content

localized_unexpected_text

Function localized_unexpected_text 

Source
pub fn localized_unexpected_text(detail: &str) -> String
Expand description

Localizes the human line for a failure that carries no product error type.

§Why this exists (C2)

localized_error_text only accepts an SshCliError. The last branch of resolve_exit_code handles an anyhow chain that downcast to neither SshCliError nor DomainError, and it printed the raw chain regardless of --lang. B2 localized every typed error and left that one untranslated, so the failure a user is least equipped to interpret stayed English-only.

Unlike the typed path there is nothing to fail open to — the caller has no alternative rendering — so this returns String, never Option. The detail is the upstream chain verbatim and stays English; only the label that classifies it is translated.

The --json envelope is untouched and keeps error_code "unexpected".