From 35264e8a121fa715ece0ff31485ee37e605edf36 Mon Sep 17 00:00:00 2001 From: Tyrrrz Date: Sun, 18 Jul 2021 00:15:06 +0300 Subject: [PATCH] Improve "Requested resource does not exist" exception message to give slightly more context --- DiscordChatExporter.Core/Discord/DiscordClient.cs | 2 +- .../Exceptions/DiscordChatExporterException.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DiscordChatExporter.Core/Discord/DiscordClient.cs b/DiscordChatExporter.Core/Discord/DiscordClient.cs index e67bce5..3a09070 100644 --- a/DiscordChatExporter.Core/Discord/DiscordClient.cs +++ b/DiscordChatExporter.Core/Discord/DiscordClient.cs @@ -51,7 +51,7 @@ namespace DiscordChatExporter.Core.Discord { HttpStatusCode.Unauthorized => DiscordChatExporterException.Unauthorized(), HttpStatusCode.Forbidden => DiscordChatExporterException.Forbidden(), - HttpStatusCode.NotFound => DiscordChatExporterException.NotFound(), + HttpStatusCode.NotFound => DiscordChatExporterException.NotFound(url), _ => DiscordChatExporterException.FailedHttpRequest(response) }; } diff --git a/DiscordChatExporter.Core/Exceptions/DiscordChatExporterException.cs b/DiscordChatExporter.Core/Exceptions/DiscordChatExporterException.cs index 270e334..d6b4d53 100644 --- a/DiscordChatExporter.Core/Exceptions/DiscordChatExporterException.cs +++ b/DiscordChatExporter.Core/Exceptions/DiscordChatExporterException.cs @@ -36,8 +36,8 @@ Failed to perform an HTTP request. internal static DiscordChatExporterException Forbidden() => new("Access is forbidden."); - internal static DiscordChatExporterException NotFound() => - new("Requested resource does not exist."); + internal static DiscordChatExporterException NotFound(string resourceId) => + new($"Requested resource ({resourceId}) does not exist."); internal static DiscordChatExporterException ChannelIsEmpty() => new("No messages found for the specified period.");