From 263a606bffd9f1cb0ed2b9d1b3b72170ea715f5d Mon Sep 17 00:00:00 2001 From: Alexey Golub Date: Sun, 1 Oct 2017 01:49:39 +0300 Subject: [PATCH] Improve error messages --- DiscordChatExporter/ViewModels/MainViewModel.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/DiscordChatExporter/ViewModels/MainViewModel.cs b/DiscordChatExporter/ViewModels/MainViewModel.cs index 891789f..b8d66b7 100644 --- a/DiscordChatExporter/ViewModels/MainViewModel.cs +++ b/DiscordChatExporter/ViewModels/MainViewModel.cs @@ -138,7 +138,12 @@ namespace DiscordChatExporter.ViewModels } catch (HttpErrorStatusCodeException ex) when (ex.StatusCode == HttpStatusCode.Unauthorized) { - const string message = "Could not authorize using the given token. Make sure it's valid."; + const string message = "Unauthorized to perform request. Make sure token is valid."; + MessengerInstance.Send(new ShowErrorMessage(message)); + } + catch (HttpErrorStatusCodeException ex) when (ex.StatusCode == HttpStatusCode.Forbidden) + { + const string message = "Forbidden to perform request. The account may be locked by 2FA."; MessengerInstance.Send(new ShowErrorMessage(message)); } @@ -188,7 +193,7 @@ namespace DiscordChatExporter.ViewModels } catch (HttpErrorStatusCodeException ex) when (ex.StatusCode == HttpStatusCode.Forbidden) { - const string message = "You don't have access to the messages in that channel."; + const string message = "Forbidden to view messages in that channel."; MessengerInstance.Send(new ShowErrorMessage(message)); }