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

pull/678/head
Tyrrrz 3 years ago
parent 2ab6773c17
commit 35264e8a12

@ -51,7 +51,7 @@ namespace DiscordChatExporter.Core.Discord
{ {
HttpStatusCode.Unauthorized => DiscordChatExporterException.Unauthorized(), HttpStatusCode.Unauthorized => DiscordChatExporterException.Unauthorized(),
HttpStatusCode.Forbidden => DiscordChatExporterException.Forbidden(), HttpStatusCode.Forbidden => DiscordChatExporterException.Forbidden(),
HttpStatusCode.NotFound => DiscordChatExporterException.NotFound(), HttpStatusCode.NotFound => DiscordChatExporterException.NotFound(url),
_ => DiscordChatExporterException.FailedHttpRequest(response) _ => DiscordChatExporterException.FailedHttpRequest(response)
}; };
} }

@ -36,8 +36,8 @@ Failed to perform an HTTP request.
internal static DiscordChatExporterException Forbidden() => internal static DiscordChatExporterException Forbidden() =>
new("Access is forbidden."); new("Access is forbidden.");
internal static DiscordChatExporterException NotFound() => internal static DiscordChatExporterException NotFound(string resourceId) =>
new("Requested resource does not exist."); new($"Requested resource ({resourceId}) does not exist.");
internal static DiscordChatExporterException ChannelIsEmpty() => internal static DiscordChatExporterException ChannelIsEmpty() =>
new("No messages found for the specified period."); new("No messages found for the specified period.");

Loading…
Cancel
Save