From 22aca51fd31272fc69d6130701a055f5663b116a Mon Sep 17 00:00:00 2001 From: Daniel Luberda Date: Fri, 11 Nov 2016 10:36:43 +0100 Subject: [PATCH] DownloadCache refactorings --- source/FFImageLoading.Common/Cache/DownloadCache.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/FFImageLoading.Common/Cache/DownloadCache.cs b/source/FFImageLoading.Common/Cache/DownloadCache.cs index a69b847b3..9be12044a 100644 --- a/source/FFImageLoading.Common/Cache/DownloadCache.cs +++ b/source/FFImageLoading.Common/Cache/DownloadCache.cs @@ -58,7 +58,7 @@ public virtual async Task DownloadAndCacheIfNeededAsync(string url, () => configuration.Logger.Debug(string.Format("Retry download: {0}", url))); if (responseBytes == null) - return null; + throw new HttpRequestException("No Content"); if (allowDiskCaching) { @@ -88,7 +88,7 @@ protected virtual async Task DownloadAsync(string url, CancellationToken throw new HttpRequestException(response.StatusCode.ToString()); if (response.Content == null) - throw new HttpRequestException("No HttpContent"); + throw new HttpRequestException("No Content"); using (var cancelReadTimeoutToken = new CancellationTokenSource()) {