[Shared] Uses underlying error messages (if available) for ALTServerError.invalidRequest/.invalidResponse

This commit is contained in:
Riley Testut
2022-12-12 15:40:20 -06:00
committed by Magesh K
parent 6c7223b991
commit e96a5114e5

View File

@@ -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;