Render an actionable, accurate error message for this issue. All messages point at registering an identity, since that is the single command that establishes a usable credential for a remote.
(&self)
| 259 | /// All messages point at registering an identity, since that is the single |
| 260 | /// command that establishes a usable credential for a remote. |
| 261 | fn message(&self) -> String { |
| 262 | match self { |
| 263 | CredentialIssue::NoIdentityInUrl => format!( |
| 264 | "Not authenticated for {REMEDY_PREFIX}: could not determine an \ |
| 265 | identity from the remote URL, and no --identity was given. \ |
| 266 | Pass --identity <NAME> (see `atomic identity list`). {REMEDY_SUFFIX}" |
| 267 | ), |
| 268 | // When the name was inferred from the URL, the fix is usually to |
| 269 | // pass --identity explicitly; when it came from --identity, the |
| 270 | // name itself is wrong. Tailor the hint to the source. |
| 271 | CredentialIssue::IdentityNotFound { |
| 272 | name, |
| 273 | from_flag: false, |
| 274 | } => format!( |
| 275 | "Not authenticated for {REMEDY_PREFIX}: identity '{name}' \ |
| 276 | (inferred from the remote URL) is not registered on this \ |
| 277 | machine. Pass --identity <NAME> to select a local identity \ |
| 278 | (see `atomic identity list`). {REMEDY_SUFFIX}" |
| 279 | ), |
| 280 | CredentialIssue::IdentityNotFound { |
| 281 | name, |
| 282 | from_flag: true, |
| 283 | } => format!( |
| 284 | "Not authenticated for {REMEDY_PREFIX}: --identity '{name}' does \ |
| 285 | not match any identity on this machine (see `atomic identity \ |
| 286 | list`). {REMEDY_SUFFIX}" |
| 287 | ), |
| 288 | CredentialIssue::KeypairUnavailable { name } => format!( |
| 289 | "Not authenticated for {REMEDY_PREFIX}: could not load the signing \ |
| 290 | key for identity '{name}'. {REMEDY_SUFFIX}" |
| 291 | ), |
| 292 | } |
| 293 | } |
| 294 | } |
| 295 | |
| 296 | const REMEDY_PREFIX: &str = "this remote"; |
no outgoing calls