Skip to content

Commit

Permalink
use notfication instead of alert box when update check fails (close #14)
Browse files Browse the repository at this point in the history
introduce ~/.asepsis-suppress-update-errors
  • Loading branch information
darwin committed Jul 27, 2014
1 parent 543968c commit 1d78743
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion updater/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,19 @@ - (void)didNotFindUpdate {

- (void)abortUpdateWithError:(NSError *)error {
DLOG(@"abortUpdateWithError %@", error);
[super abortUpdateWithError:error];
NSString* suppressUpdateErrorsFlag = [@"~/.asepsis-suppress-update-errors" stringByStandardizingPath];
BOOL suppressUpdateError = [[NSFileManager defaultManager] fileExistsAtPath:suppressUpdateErrorsFlag];
if (!suppressUpdateError) {
NSUserNotification* notification = [[NSUserNotification alloc] init];
notification.title = [NSString stringWithFormat:@"Asepsis update check failed"];
notification.informativeText = [error localizedDescription];
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];
} else {
DLOG(@" => update error notification suppressed");
}
if (download)
[download cancel];
[self abortUpdate];
}

- (void)abortUpdate {
Expand Down

0 comments on commit 1d78743

Please sign in to comment.