From 82add5cd50c637978d1b8440d447d6ff561e752a Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Mon, 10 Feb 2020 23:16:39 +0100 Subject: [PATCH] Adding error messages for the thumbnail downloader --- Kyoo/Controllers/ThumbnailsManager.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Kyoo/Controllers/ThumbnailsManager.cs b/Kyoo/Controllers/ThumbnailsManager.cs index c1d255c8..40b569e6 100644 --- a/Kyoo/Controllers/ThumbnailsManager.cs +++ b/Kyoo/Controllers/ThumbnailsManager.cs @@ -33,9 +33,9 @@ namespace Kyoo.Controllers using WebClient client = new WebClient(); await client.DownloadFileTaskAsync(new Uri(show.ImgPrimary), localThumb); } - catch (WebException) + catch (WebException exception) { - Console.Error.WriteLine("Couldn't download an image."); + Console.Error.WriteLine($"\tThe poster of {show.Title} could not be downloaded.\n\tError: {exception.Message}. "); } } @@ -46,9 +46,9 @@ namespace Kyoo.Controllers using WebClient client = new WebClient(); await client.DownloadFileTaskAsync(new Uri(show.ImgLogo), localLogo); } - catch (WebException) + catch (WebException exception) { - Console.Error.WriteLine("Couldn't download an image."); + Console.Error.WriteLine($"\tThe logo of {show.Title} could not be downloaded.\n\tError: {exception.Message}. "); } } @@ -59,9 +59,9 @@ namespace Kyoo.Controllers using WebClient client = new WebClient(); await client.DownloadFileTaskAsync(new Uri(show.ImgBackdrop), localBackdrop); } - catch (WebException) + catch (WebException exception) { - Console.Error.WriteLine("Couldn't download an image."); + Console.Error.WriteLine($"\tThe backdrop of {show.Title} could not be downloaded.\n\tError: {exception.Message}. "); } } @@ -85,9 +85,9 @@ namespace Kyoo.Controllers using WebClient client = new WebClient(); await client.DownloadFileTaskAsync(new Uri(peop.People.ImgPrimary), localThumb); } - catch (WebException) + catch (WebException exception) { - Console.Error.WriteLine("Couldn't download an image."); + Console.Error.WriteLine($"\tThe profile picture of {peop.People.Name} could not be downloaded.\n\tError: {exception.Message}. "); } } @@ -106,9 +106,9 @@ namespace Kyoo.Controllers using WebClient client = new WebClient(); await client.DownloadFileTaskAsync(new Uri(episode.ImgPrimary), localThumb); } - catch (WebException) + catch (WebException exception) { - Console.Error.WriteLine("Couldn't download an image."); + Console.Error.WriteLine($"\tThe thumbnail of {episode.Show.Title} s{episode.SeasonNumber}e{episode.EpisodeNumber} could not be downloaded.\n\tError: {exception.Message}. "); } return episode;