Don't print terrible upstream errors
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
eb736cf413
commit
d467dfb2d1
|
@ -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>,
|
||||
|
|
|
@ -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(_) => {
|
||||
|
|
Loading…
Reference in a new issue