mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-18 18:51:16 +10:00
feat(errors): better download manager errors + modal
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
use std::{
|
||||
error::Error,
|
||||
fmt::{Display, Formatter},
|
||||
sync::{Arc, Mutex},
|
||||
};
|
||||
@ -26,7 +27,16 @@ pub enum RemoteAccessError {
|
||||
impl Display for RemoteAccessError {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
RemoteAccessError::FetchError(error) => write!(f, "{}", error),
|
||||
RemoteAccessError::FetchError(error) => write!(
|
||||
f,
|
||||
"{}: {}",
|
||||
error,
|
||||
error
|
||||
.source()
|
||||
.map(|e| e.to_string())
|
||||
.or_else(|| Some("Unknown error".to_string()))
|
||||
.unwrap()
|
||||
),
|
||||
RemoteAccessError::ParsingError(parse_error) => {
|
||||
write!(f, "{}", parse_error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user