From: Simon Tatham Date: Wed, 24 Jan 2024 08:48:11 +0000 (+0000) Subject: Change the message for AuthError::Nonexistent. X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=540edf3a9ad611eb989986e057451e2f595b8c22;p=mastodonochrome.git Change the message for AuthError::Nonexistent. "Not logged in" used to be correct, when we didn't support account registration. But now the auth file can _exist_ while still being logged in. So we should be more precise in the translation of this error code: it really means /auth is absent in an ENOENT sort of way. However, we shouldn't normally _see_ that message: it's one of the few error cases that we detect programmatically and divert into a handler for (to wit, the login flow). --- diff --git a/src/auth.rs b/src/auth.rs index e98f24c..78a174d 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -17,7 +17,7 @@ impl std::fmt::Display for AuthError { ) -> Result<(), std::fmt::Error> { match self { AuthError::Nonexistent(_) => { - write!(f, "not logged in") + write!(f, "no saved authentication file") } AuthError::Bad(ref msg) => { write!(f, "unable to read authentication: {}", msg)