diff options
Diffstat (limited to 'Xamarin.Forms.Platform.WinRT/WindowsBasePlatformServices.cs')
-rw-r--r-- | Xamarin.Forms.Platform.WinRT/WindowsBasePlatformServices.cs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Xamarin.Forms.Platform.WinRT/WindowsBasePlatformServices.cs b/Xamarin.Forms.Platform.WinRT/WindowsBasePlatformServices.cs index 603ec401..49589a8a 100644 --- a/Xamarin.Forms.Platform.WinRT/WindowsBasePlatformServices.cs +++ b/Xamarin.Forms.Platform.WinRT/WindowsBasePlatformServices.cs @@ -99,7 +99,14 @@ namespace Xamarin.Forms.Platform.WinRT using (var client = new HttpClient()) { HttpResponseMessage streamResponse = await client.GetAsync(uri.AbsoluteUri).ConfigureAwait(false); - return streamResponse.IsSuccessStatusCode ? await streamResponse.Content.ReadAsStreamAsync().ConfigureAwait(false) : null; + + if (!streamResponse.IsSuccessStatusCode) + { + Log.Warning("HTTP Request", $"Could not retrieve {uri}, status code {streamResponse.StatusCode}"); + return null; + } + + return await streamResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); } } |