From d08854c13f24488358b95db49b38f33f922d5c6d Mon Sep 17 00:00:00 2001 From: asonix Date: Mon, 17 Jul 2023 22:01:31 -0500 Subject: [PATCH] Don't print terrible upstream errors --- src/main.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main.rs b/src/main.rs index 96e4901..e1b5b74 100644 --- a/src/main.rs +++ b/src/main.rs @@ -345,6 +345,15 @@ pub struct Error { kind: ErrorKind, } +impl Error { + pub(crate) fn upstream_error(&self) -> Option<&str> { + match self.kind { + ErrorKind::UploadFailed(ref msg) => Some(msg), + _ => None, + } + } +} + impl From for Error where ErrorKind: From,