mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-10 18:06:37 +02:00
Rename ChannelNotExportedException.cs -> ChannelEmptyException.cs as discussed
This commit is contained in:
parent
3eff5faa2c
commit
3c0bf8a125
4 changed files with 5 additions and 5 deletions
|
@ -237,7 +237,7 @@ public abstract class ExportCommandBase : DiscordCommandBase
|
|||
}
|
||||
);
|
||||
}
|
||||
catch (ChannelNotExportedException ex) {
|
||||
catch (ChannelEmptyException ex) {
|
||||
warningsByChannel[channel] = ex.Message;
|
||||
}
|
||||
catch (DiscordChatExporterException ex) when (!ex.IsFatal)
|
||||
|
|
|
@ -4,6 +4,6 @@ namespace DiscordChatExporter.Core.Exceptions;
|
|||
|
||||
// Thrown when there is circumstancially no message to export with given parameters,
|
||||
// though it should not be treated as a runtime error; simply warn instead
|
||||
public class ChannelNotExportedException(string message)
|
||||
public class ChannelEmptyException(string message)
|
||||
: DiscordChatExporterException(message, false, null) {
|
||||
}
|
|
@ -38,7 +38,7 @@ public class ChannelExporter(DiscordClient discord)
|
|||
// Check if the channel is empty
|
||||
if (request.Channel.IsEmpty)
|
||||
{
|
||||
throw new ChannelNotExportedException(
|
||||
throw new ChannelEmptyException(
|
||||
$"Channel '{request.Channel.Name}' "
|
||||
+ $"of guild '{request.Guild.Name}' "
|
||||
+ $"does not contain any messages; an empty file will be created."
|
||||
|
@ -49,7 +49,7 @@ public class ChannelExporter(DiscordClient discord)
|
|||
if ((request.Before is not null && !request.Channel.MayHaveMessagesBefore(request.Before.Value)) ||
|
||||
(request.After is not null && !request.Channel.MayHaveMessagesAfter(request.After.Value)))
|
||||
{
|
||||
throw new ChannelNotExportedException(
|
||||
throw new ChannelEmptyException(
|
||||
$"Channel '{request.Channel.Name}' "
|
||||
+ $"of guild '{request.Guild.Name}' "
|
||||
+ $"does not contain any messages within the specified period; an empty file will be created."
|
||||
|
|
|
@ -283,7 +283,7 @@ public partial class DashboardViewModel : ViewModelBase
|
|||
|
||||
Interlocked.Increment(ref successfulExportCount);
|
||||
}
|
||||
catch (ChannelNotExportedException ex) {
|
||||
catch (ChannelEmptyException ex) {
|
||||
_snackbarManager.Notify(ex.Message.TrimEnd('.'));
|
||||
|
||||
// FIXME: not exactly successful, but not a failure either. Not ideal to duplicate the line
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue