[AltKit] Includes underlying error in error response

This commit is contained in:
Riley Testut
2020-06-05 14:19:40 -07:00
parent fafec6c904
commit 186ad09ab3
3 changed files with 79 additions and 11 deletions

View File

@@ -39,13 +39,19 @@ NSErrorUserInfoKey const ALTProvisioningProfileBundleIDErrorKey = @"bundleIdenti
{
case ALTServerErrorUnderlyingError:
{
NSString *underlyingErrorCode = self.userInfo[ALTUnderlyingErrorCodeErrorKey];
if (underlyingErrorCode == nil)
NSError *underlyingError = self.userInfo[NSUnderlyingErrorKey];
if (underlyingError.localizedFailureReason != nil)
{
return NSLocalizedString(@"An unknown error occured.", @"");
return underlyingError.localizedFailureReason;
}
NSString *underlyingErrorCode = self.userInfo[ALTUnderlyingErrorCodeErrorKey];
if (underlyingErrorCode != nil)
{
return [NSString stringWithFormat:NSLocalizedString(@"Error code: %@", @""), underlyingErrorCode];
}
return [NSString stringWithFormat:NSLocalizedString(@"Error code: %@", @""), underlyingErrorCode];
return NSLocalizedString(@"An internal error occured.", @"");
}
case ALTServerErrorUnknown: