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];
|
||||
return underlyingError.localizedDescription;
|
||||
}
|
||||
|
||||
case ALTServerErrorInvalidRequest:
|
||||
case ALTServerErrorInvalidResponse:
|
||||
{
|
||||
NSError *underlyingError = self.userInfo[NSUnderlyingErrorKey];
|
||||
if (underlyingError != nil)
|
||||
{
|
||||
return underlyingError.localizedDescription;
|
||||
}
|
||||
}
|
||||
|
||||
default:
|
||||
return nil;
|
||||
}
|
||||
@@ -167,10 +178,26 @@ NSErrorUserInfoKey const ALTOperatingSystemVersionErrorKey = @"ALTOperatingSyste
|
||||
return NSLocalizedString(@"SideStore could not write data to this device.", @"");
|
||||
|
||||
case ALTServerErrorInvalidRequest:
|
||||
{
|
||||
NSError *underlyingError = self.userInfo[NSUnderlyingErrorKey];
|
||||
if (underlyingError.localizedFailureReason != nil)
|
||||
{
|
||||
return underlyingError.localizedFailureReason;
|
||||
}
|
||||
|
||||
return NSLocalizedString(@"SideStore received an invalid request.", @"");
|
||||
}
|
||||
|
||||
case ALTServerErrorInvalidResponse:
|
||||
{
|
||||
NSError *underlyingError = self.userInfo[NSUnderlyingErrorKey];
|
||||
if (underlyingError.localizedFailureReason != nil)
|
||||
{
|
||||
return underlyingError.localizedFailureReason;
|
||||
}
|
||||
|
||||
return NSLocalizedString(@"SideStore sent an invalid response.", @"");
|
||||
}
|
||||
|
||||
case ALTServerErrorInvalidApp:
|
||||
return NSLocalizedString(@"The app is in an invalid format.", @"");
|
||||
@@ -282,6 +309,8 @@ NSErrorUserInfoKey const ALTOperatingSystemVersionErrorKey = @"ALTOperatingSyste
|
||||
switch ((ALTServerError)self.code)
|
||||
{
|
||||
case ALTServerErrorUnderlyingError:
|
||||
case ALTServerErrorInvalidRequest:
|
||||
case ALTServerErrorInvalidResponse:
|
||||
{
|
||||
NSError *underlyingError = self.userInfo[NSUnderlyingErrorKey];
|
||||
return underlyingError.alt_localizedDebugDescription;
|
||||
|
||||
Reference in New Issue
Block a user