mirror of
https://github.com/silkimen/cordova-plugin-advanced-http.git
synced 2026-05-12 00:03:02 +08:00
fix #83: handle error during file download correctly on iOS
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user