Don't print terrible upstream errors
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
asonix 2023-07-17 22:01:31 -05:00
parent eb736cf413
commit d467dfb2d1
2 changed files with 13 additions and 0 deletions

View file

@ -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<T> From<T> for Error
where
ErrorKind: From<T>,

View file

@ -48,7 +48,11 @@
UploadResult::Error(error) => {
<p>
Error:<br />
@if let Some(msg) = error.upstream_error() {
@msg
} else {
@error.to_string()
}
</p>
}
UploadResult::UploadId(_) => {