mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-29 22:15:18 -04:00
Improve error messages
This commit is contained in:
parent
026927265a
commit
58464d8708
1 changed files with 10 additions and 20 deletions
|
@ -21,35 +21,25 @@ namespace DiscordChatExporter.Core.Exceptions
|
||||||
var message = $@"
|
var message = $@"
|
||||||
Failed to perform an HTTP request.
|
Failed to perform an HTTP request.
|
||||||
|
|
||||||
|
[Request]
|
||||||
{response.RequestMessage}
|
{response.RequestMessage}
|
||||||
|
|
||||||
|
[Response]
|
||||||
{response}";
|
{response}";
|
||||||
|
|
||||||
return new DiscordChatExporterException(message.Trim(), true);
|
return new DiscordChatExporterException(message.Trim(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static DiscordChatExporterException Unauthorized()
|
internal static DiscordChatExporterException Unauthorized() =>
|
||||||
{
|
new("Authentication token is invalid.");
|
||||||
const string message = "Authentication token is invalid.";
|
|
||||||
return new DiscordChatExporterException(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static DiscordChatExporterException Forbidden()
|
internal static DiscordChatExporterException Forbidden() =>
|
||||||
{
|
new("Access is forbidden.");
|
||||||
const string message = "Access is forbidden.";
|
|
||||||
return new DiscordChatExporterException(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static DiscordChatExporterException NotFound()
|
internal static DiscordChatExporterException NotFound() =>
|
||||||
{
|
new("Requested resource does not exist.");
|
||||||
const string message = "Requested resource does not exist.";
|
|
||||||
return new DiscordChatExporterException(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static DiscordChatExporterException ChannelIsEmpty()
|
internal static DiscordChatExporterException ChannelIsEmpty() =>
|
||||||
{
|
new("No messages found for the specified period.");
|
||||||
var message = $"No messages for the specified period.";
|
|
||||||
return new DiscordChatExporterException(message);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue