Merge pull request #318 from Coeur/errorForCompletionHandler
giving an NSError to completionHandler on failure
This commit is contained in:
@@ -254,6 +254,7 @@
|
||||
}
|
||||
|
||||
if (ret != UNZ_OK) {
|
||||
unzippingError = [NSError errorWithDomain:@"SSZipArchiveErrorDomain" code:-2 userInfo:@{NSLocalizedDescriptionKey: @"failed to open file in zip file"}];
|
||||
success = NO;
|
||||
break;
|
||||
}
|
||||
@@ -264,6 +265,7 @@
|
||||
|
||||
ret = unzGetCurrentFileInfo(zip, &fileInfo, NULL, 0, NULL, 0, NULL, 0);
|
||||
if (ret != UNZ_OK) {
|
||||
unzippingError = [NSError errorWithDomain:@"SSZipArchiveErrorDomain" code:-3 userInfo:@{NSLocalizedDescriptionKey: @"failed to retrieve info for file"}];
|
||||
success = NO;
|
||||
unzCloseCurrentFile(zip);
|
||||
break;
|
||||
@@ -292,7 +294,8 @@
|
||||
char *filename = (char *)malloc(fileInfo.size_filename + 1);
|
||||
if (filename == NULL)
|
||||
{
|
||||
return NO;
|
||||
success = NO;
|
||||
break;
|
||||
}
|
||||
|
||||
unzGetCurrentFileInfo(zip, &fileInfo, filename, fileInfo.size_filename + 1, NULL, 0, NULL, 0);
|
||||
|
||||
Reference in New Issue
Block a user