Improve "Requested resource does not exist" exception message to give slightly more context

This commit is contained in:
Tyrrrz 2021-07-18 00:15:06 +03:00
parent 2ab6773c17
commit 35264e8a12
2 changed files with 3 additions and 3 deletions

View file

@ -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)
};
}

View file

@ -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.");