mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-08 22:33:26 +01:00
[Shared] Uses underlying error messages (if available) for ALTServerError.invalidRequest/.invalidResponse
This commit is contained in:
@@ -81,6 +81,17 @@ NSErrorUserInfoKey const ALTOperatingSystemVersionErrorKey = @"ALTOperatingSyste
|
|||||||
NSError *underlyingError = self.userInfo[NSUnderlyingErrorKey];
|
NSError *underlyingError = self.userInfo[NSUnderlyingErrorKey];
|
||||||
return underlyingError.localizedDescription;
|
return underlyingError.localizedDescription;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case ALTServerErrorInvalidRequest:
|
||||||
|
case ALTServerErrorInvalidResponse:
|
||||||
|
{
|
||||||
|
NSError *underlyingError = self.userInfo[NSUnderlyingErrorKey];
|
||||||
|
if (underlyingError != nil)
|
||||||
|
{
|
||||||
|
return underlyingError.localizedDescription;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
@@ -167,10 +178,26 @@ NSErrorUserInfoKey const ALTOperatingSystemVersionErrorKey = @"ALTOperatingSyste
|
|||||||
return NSLocalizedString(@"SideStore could not write data to this device.", @"");
|
return NSLocalizedString(@"SideStore could not write data to this device.", @"");
|
||||||
|
|
||||||
case ALTServerErrorInvalidRequest:
|
case ALTServerErrorInvalidRequest:
|
||||||
|
{
|
||||||
|
NSError *underlyingError = self.userInfo[NSUnderlyingErrorKey];
|
||||||
|
if (underlyingError.localizedFailureReason != nil)
|
||||||
|
{
|
||||||
|
return underlyingError.localizedFailureReason;
|
||||||
|
}
|
||||||
|
|
||||||
return NSLocalizedString(@"SideStore received an invalid request.", @"");
|
return NSLocalizedString(@"SideStore received an invalid request.", @"");
|
||||||
|
}
|
||||||
|
|
||||||
case ALTServerErrorInvalidResponse:
|
case ALTServerErrorInvalidResponse:
|
||||||
|
{
|
||||||
|
NSError *underlyingError = self.userInfo[NSUnderlyingErrorKey];
|
||||||
|
if (underlyingError.localizedFailureReason != nil)
|
||||||
|
{
|
||||||
|
return underlyingError.localizedFailureReason;
|
||||||
|
}
|
||||||
|
|
||||||
return NSLocalizedString(@"SideStore sent an invalid response.", @"");
|
return NSLocalizedString(@"SideStore sent an invalid response.", @"");
|
||||||
|
}
|
||||||
|
|
||||||
case ALTServerErrorInvalidApp:
|
case ALTServerErrorInvalidApp:
|
||||||
return NSLocalizedString(@"The app is in an invalid format.", @"");
|
return NSLocalizedString(@"The app is in an invalid format.", @"");
|
||||||
@@ -282,6 +309,8 @@ NSErrorUserInfoKey const ALTOperatingSystemVersionErrorKey = @"ALTOperatingSyste
|
|||||||
switch ((ALTServerError)self.code)
|
switch ((ALTServerError)self.code)
|
||||||
{
|
{
|
||||||
case ALTServerErrorUnderlyingError:
|
case ALTServerErrorUnderlyingError:
|
||||||
|
case ALTServerErrorInvalidRequest:
|
||||||
|
case ALTServerErrorInvalidResponse:
|
||||||
{
|
{
|
||||||
NSError *underlyingError = self.userInfo[NSUnderlyingErrorKey];
|
NSError *underlyingError = self.userInfo[NSUnderlyingErrorKey];
|
||||||
return underlyingError.alt_localizedDebugDescription;
|
return underlyingError.alt_localizedDebugDescription;
|
||||||
|
|||||||
Reference in New Issue
Block a user