chiark / gitweb /
Fix misreporting of HTTP errors not about auth.
authorSimon Tatham <anakin@pobox.com>
Sun, 31 Dec 2023 14:01:00 +0000 (14:01 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 31 Dec 2023 14:06:32 +0000 (14:06 +0000)
The prefix "unable to read authentication" was in the wrong part of my
error handling edifice.

src/tui.rs

index 5a17b816431e87fbbd8a43df9350fedfec57acae..4b8ad00dfb628ea9349f7d65b32d92c9d69e1835 100644 (file)
@@ -172,7 +172,7 @@ impl From<std::io::Error> for TuiError {
 impl From<AuthError> for TuiError {
     fn from(err: AuthError) -> Self {
         TuiError {
-            message: err.to_string(),
+            message: format!("unable to read authentication: {}", err),
         }
     }
 }
@@ -188,7 +188,7 @@ impl std::fmt::Display for TuiError {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) ->
         Result<(), std::fmt::Error>
     {
-        write!(f, "unable to read authentication: {}", self.message)
+        write!(f, "{}", self.message)
     }
 }