From 7a6d4bd380227a94ea849a753d0f1abc1895feb4 Mon Sep 17 00:00:00 2001 From: Benjamin Gordon Date: Sat, 4 Oct 2014 16:17:51 -0600 Subject: [PATCH] Added SUUpdater delegate method for failures. --- Sparkle/SUBasicUpdateDriver.m | 7 +++++++ Sparkle/SUUpdater.h | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/Sparkle/SUBasicUpdateDriver.m b/Sparkle/SUBasicUpdateDriver.m index 12147df7..c426849b 100644 --- a/Sparkle/SUBasicUpdateDriver.m +++ b/Sparkle/SUBasicUpdateDriver.m @@ -436,6 +436,13 @@ if (self.download) { [self.download cancel]; } + + // Notify host app that update has aborted + id updaterDelegate = [self.updater delegate]; + if ([updaterDelegate respondsToSelector:@selector(updater:didAbortWithError:)]) { + [updaterDelegate updater:self.updater didAbortWithError:error]; + } + [self abortUpdate]; } diff --git a/Sparkle/SUUpdater.h b/Sparkle/SUUpdater.h index f83fed5b..6d9c98d3 100644 --- a/Sparkle/SUUpdater.h +++ b/Sparkle/SUUpdater.h @@ -312,6 +312,14 @@ SU_EXPORT extern NSString *const SUUpdaterAppcastNotificationKey; */ - (void)updater:(SUUpdater *)updater didCancelInstallUpdateOnQuit:(SUAppcastItem *)item; +/*! + Called after an update is aborted due to an error. + + \param updater The SUUpdater instance. + \param error The error that caused the abort + */ +- (void)updater:(SUUpdater *)updater didAbortWithError:(NSError *)error; + @end #endif