Add developer mode not enabled error kind

This commit is contained in:
Jackson Coxson
2025-09-25 12:55:13 -06:00
parent 9f7e57bb21
commit 604aec72f2

View File

@@ -720,6 +720,9 @@ pub enum IdeviceError {
#[cfg(feature = "installation_proxy")] #[cfg(feature = "installation_proxy")]
#[error("malformed package archive: {0}")] #[error("malformed package archive: {0}")]
MalformedPackageArchive(#[from] async_zip::error::ZipError) = -67, MalformedPackageArchive(#[from] async_zip::error::ZipError) = -67,
#[error("Developer mode is not enabled")]
DeveloperModeNotEnabled = -68,
} }
impl IdeviceError { impl IdeviceError {
@@ -734,6 +737,8 @@ impl IdeviceError {
fn from_device_error_type(e: &str, context: &plist::Dictionary) -> Option<Self> { fn from_device_error_type(e: &str, context: &plist::Dictionary) -> Option<Self> {
if e.contains("NSDebugDescription=Canceled by user.") { if e.contains("NSDebugDescription=Canceled by user.") {
return Some(Self::CanceledByUser); return Some(Self::CanceledByUser);
} else if e.contains("Developer mode is not enabled.") {
return Some(Self::DeveloperModeNotEnabled);
} }
match e { match e {
"GetProhibited" => Some(Self::GetProhibited), "GetProhibited" => Some(Self::GetProhibited),
@@ -881,6 +886,7 @@ impl IdeviceError {
#[cfg(feature = "installation_proxy")] #[cfg(feature = "installation_proxy")]
IdeviceError::MalformedPackageArchive(_) => -67, IdeviceError::MalformedPackageArchive(_) => -67,
IdeviceError::DeveloperModeNotEnabled => -68,
} }
} }
} }