Merge pull request #6743 from electron/recovery-suggestion
Add recovery suggestion to auto update failure string
This commit is contained in:
commit
fd461cdd27
1 changed files with 12 additions and 5 deletions
|
@ -104,11 +104,18 @@ void AutoUpdater::CheckForUpdates() {
|
||||||
delegate->OnUpdateNotAvailable();
|
delegate->OnUpdateNotAvailable();
|
||||||
}
|
}
|
||||||
} error:^(NSError *error) {
|
} error:^(NSError *error) {
|
||||||
NSString* failureString = error.localizedFailureReason ?
|
NSMutableString* failureString =
|
||||||
[NSString stringWithFormat:@"%@: %@",
|
[NSMutableString stringWithString:error.localizedDescription];
|
||||||
error.localizedDescription,
|
if (error.localizedFailureReason) {
|
||||||
error.localizedFailureReason] :
|
[failureString appendString:@": "];
|
||||||
[NSString stringWithString:error.localizedDescription];
|
[failureString appendString:error.localizedFailureReason];
|
||||||
|
}
|
||||||
|
if (error.localizedRecoverySuggestion) {
|
||||||
|
if (![failureString hasSuffix:@"."])
|
||||||
|
[failureString appendString:@"."];
|
||||||
|
[failureString appendString:@" "];
|
||||||
|
[failureString appendString:error.localizedRecoverySuggestion];
|
||||||
|
}
|
||||||
delegate->OnError(base::SysNSStringToUTF8(failureString));
|
delegate->OnError(base::SysNSStringToUTF8(failureString));
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue