Commit cc032a80 authored by Felix Paul Kühne's avatar Felix Paul Kühne

DropboxController: tell the user if we encounter an error

parent a85b41b8
......@@ -134,6 +134,7 @@
- (void)restClient:(DBRestClient *)client loadMetadataFailedWithError:(NSError *)error
{
APLog(@"DBMetadata download failed with error %i", error.code);
[self _handleError:error];
}
- (void)restClient:(DBRestClient*)client loadedFile:(NSString*)localPath
......@@ -152,6 +153,7 @@
- (void)restClient:(DBRestClient*)client loadFileFailedWithError:(NSError*)error
{
APLog(@"DBFile download failed with error %i", error.code);
[self _handleError:error];
if ([self.delegate respondsToSelector:@selector(operationWithProgressInformationStopped)])
[self.delegate operationWithProgressInformationStopped];
_downloadInProgress = NO;
......@@ -175,6 +177,7 @@
- (void)restClient:(DBRestClient*)restClient loadStreamableURLFailedWithError:(NSError*)error
{
APLog(@"loadStreamableURL failed with error %i", error.code);
[self _handleError:error];
}
#pragma mark - DBSession delegate
......@@ -218,4 +221,11 @@
return 0;
}
#pragma mark - user feedback
- (void)_handleError:(NSError *)error
{
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:NSLocalizedString(@"ERROR_NUMBER", @""), error.code] message:error.localizedDescription delegate:self cancelButtonTitle:NSLocalizedString(@"BUTTON_CANCEL", @"") otherButtonTitles:nil];
[alert show];
}
@end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment