mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-27 05:04:27 +00:00
Ability to report specific unarchiving error
This commit is contained in:
1 parent
311ed493b4
commit
23b2b49663
5 files changed
+10
-11
No files matched your search
Vendored
+1
-2
@@ -74,8 +74,7 @@
|
||||
[self notifyDelegateOfSuccess];
|
||||
}
|
||||
else {
|
||||
SULog(@"Applying delta patch failed with error: %@", applyDiffError);
|
||||
[self notifyDelegateOfFailure];
|
||||
[self unarchiverDidFailWithError:applyDiffError];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-2
@@ -135,7 +135,6 @@
|
||||
|
||||
if (![manager copyItemAtPath:fromPath toPath:toPath error:&error])
|
||||
{
|
||||
SULog(@"Couldn't copy item: %@ : %@", error, error.userInfo ? error.userInfo : @"");
|
||||
goto reportError;
|
||||
}
|
||||
}
|
||||
@@ -144,7 +143,7 @@
|
||||
goto finally;
|
||||
|
||||
reportError:
|
||||
[self notifyDelegateOfFailure];
|
||||
[self unarchiverDidFailWithError:error];
|
||||
|
||||
finally:
|
||||
if (mountedSuccessfully) {
|
||||
|
||||
Vendored
+6
-5
@@ -61,7 +61,7 @@
|
||||
{
|
||||
// *** GETS CALLED ON NON-MAIN THREAD!!!
|
||||
@autoreleasepool {
|
||||
|
||||
NSError *error = nil;
|
||||
NSString *destination = [self.archivePath stringByDeletingLastPathComponent];
|
||||
|
||||
SULog(@"Extracting using '%@' '%@' < '%@' '%@'", command, [args componentsJoinedByString:@"' '"], self.archivePath, destination);
|
||||
@@ -107,16 +107,17 @@
|
||||
[self notifyDelegateOfSuccess];
|
||||
return;
|
||||
} else {
|
||||
SULog(@"Extraction failed, command '%@' got only %ld of %ld bytes", command, (long)bytesRead, (long)expectedLength);
|
||||
error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Extraction failed, command '%@' got only %ld of %ld bytes", command, (long)bytesRead, (long)expectedLength]}];
|
||||
|
||||
}
|
||||
} else {
|
||||
SULog(@"Extraction failed, command '%@' returned %d", command, [task terminationStatus]);
|
||||
error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Extraction failed, command '%@' returned %d", command, [task terminationStatus]]}];
|
||||
}
|
||||
} else {
|
||||
SULog(@"Extraction failed, archive '%@' is empty", self.archivePath);
|
||||
error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Extraction failed, archive '%@' is empty", self.archivePath]}];
|
||||
}
|
||||
|
||||
[self notifyDelegateOfFailure];
|
||||
[self unarchiverDidFailWithError:error];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -76,7 +76,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
- (void)notifyDelegateOfFailure
|
||||
- (void)unarchiverDidFailWithError:(NSError *)error
|
||||
{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if ([self.delegate respondsToSelector:@selector(unarchiverDidFail:)]) {
|
||||
|
||||
Vendored
+1
-1
@@ -20,7 +20,7 @@
|
||||
|
||||
- (void)notifyDelegateOfProgress:(double)progress;
|
||||
- (void)notifyDelegateOfSuccess;
|
||||
- (void)notifyDelegateOfFailure;
|
||||
- (void)unarchiverDidFailWithError:(NSError *)error;
|
||||
@end
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user