MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / message

Method message

atomic-cli/src/commands/auth.rs:261–293  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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
296const REMEDY_PREFIX: &str = "this remote";

Callers 15

execute_reviseMethod · 0.45
runMethod · 0.45
write_commitMethod · 0.45
extract_commit_metadataFunction · 0.45
format_defaultMethod · 0.45
format_shortMethod · 0.45
format_onelineMethod · 0.45
from_entryMethod · 0.45

Calls

no outgoing calls