mirror of
https://github.com/jkcoxson/idevice.git
synced 2026-03-02 06:26:15 +01:00
Include ErrorDescription in unknown device errors (#46)
* Include ErrorDescription in unknown device errors * Remove unused error import from tracing
This commit is contained in:
@@ -38,7 +38,7 @@ use std::{
|
|||||||
};
|
};
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt};
|
use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt};
|
||||||
use tracing::{debug, error, trace};
|
use tracing::{debug, trace};
|
||||||
|
|
||||||
pub use util::{pretty_print_dictionary, pretty_print_plist};
|
pub use util::{pretty_print_dictionary, pretty_print_plist};
|
||||||
|
|
||||||
@@ -482,7 +482,13 @@ impl Idevice {
|
|||||||
if let Some(e) = IdeviceError::from_device_error_type(e.as_str(), &res) {
|
if let Some(e) = IdeviceError::from_device_error_type(e.as_str(), &res) {
|
||||||
return Err(e);
|
return Err(e);
|
||||||
} else {
|
} else {
|
||||||
return Err(IdeviceError::UnknownErrorType(e));
|
let msg =
|
||||||
|
if let Some(desc) = res.get("ErrorDescription").and_then(|x| x.as_string()) {
|
||||||
|
format!("{} ({})", e, desc)
|
||||||
|
} else {
|
||||||
|
e
|
||||||
|
};
|
||||||
|
return Err(IdeviceError::UnknownErrorType(msg));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(res)
|
Ok(res)
|
||||||
|
|||||||
Reference in New Issue
Block a user