diff options
author | Tor Lillqvist <tml@collabora.com> | 2019-04-26 11:28:39 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2019-04-26 12:04:09 +0300 |
commit | d550944053cca481e3bae1e981b16a23132c0126 (patch) | |
tree | 675142101dfd7e1bc0217e52f434200188750a94 /ios | |
parent | 4e2ad4d2bc018584c074d91b6d5927c5c2b905bf (diff) |
tdf#124918: More logging in template download error situations
Diffstat (limited to 'ios')
-rw-r--r-- | ios/Mobile/AppDelegate.mm | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/ios/Mobile/AppDelegate.mm b/ios/Mobile/AppDelegate.mm index a9aecf080..d01712931 100644 --- a/ios/Mobile/AppDelegate.mm +++ b/ios/Mobile/AppDelegate.mm @@ -49,6 +49,10 @@ static void download(NSURL *source, NSURL *destination) { " with " << [[location absoluteString] UTF8String] << ": " << [[error description] UTF8String]); } + } else if (error == nil && [response isKindOfClass:[NSHTTPURLResponse class]]) { + LOG_ERR("Failed to download " << + [[source absoluteString] UTF8String] << + ": response code " << [(NSHTTPURLResponse*)response statusCode]); } else if (error != nil) { LOG_ERR("Failed to download " << [[source absoluteString] UTF8String] << @@ -126,6 +130,17 @@ static void updateTemplates(NSData *data, NSURLResponse *response) if ([templateDate compare:cachedTemplateDate] == NSOrderedDescending) { downloadTemplate(url, fileForTemplate); } + } else if (error == nil && [response isKindOfClass:[NSHTTPURLResponse class]]) { + LOG_ERR("Failed to get HEAD of " << + [[url absoluteString] UTF8String] << + ": response code " << [(NSHTTPURLResponse*)response statusCode]); + } else if (error != nil) { + LOG_ERR("Failed to get HEAD of " << + [[url absoluteString] UTF8String] << + ": " << [[error description] UTF8String]); + } else { + LOG_ERR("Failed to get HEAD of " << + [[url absoluteString] UTF8String]); } }] resume]; } else { @@ -184,6 +199,17 @@ static void updateTemplates(NSData *data, NSURLResponse *response) completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { if (error == nil && [response isKindOfClass:[NSHTTPURLResponse class]] && [(NSHTTPURLResponse*)response statusCode] == 200) updateTemplates(data, response); + else if (error == nil && [response isKindOfClass:[NSHTTPURLResponse class]]) + LOG_ERR("Failed to download " << + [[url absoluteString] UTF8String] << + ": response code " << [(NSHTTPURLResponse*)response statusCode]); + else if (error != nil) + LOG_ERR("Failed to download " << + [[url absoluteString] UTF8String] << + ": " << [[error description] UTF8String]); + else + LOG_ERR("Failed to download " << + [[url absoluteString] UTF8String]); }] resume]; } } |