fix #83: handle error during file download correctly on iOS

This commit is contained in:
Sefa Ilkimen
2018-02-27 14:50:30 +01:00
parent a580ce2067
commit 1d5642c8ae
2 changed files with 10 additions and 0 deletions
+1
View File
@@ -517,6 +517,7 @@
} failure:^(NSURLSessionTask *task, NSError *error) {
NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
[self handleError:dictionary withResponse:(NSHTTPURLResponse*)task.response error:error];
[dictionary setObject:@"There was an error downloading the file" forKey:@"error"];
CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:dictionary];
[weakSelf.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];