Rename ChannelNotExportedException.cs -> ChannelEmptyException.cs as discussed

This commit is contained in:
Leonardo Mosquera 2025-04-01 08:35:39 -03:00
parent 3eff5faa2c
commit 3c0bf8a125
4 changed files with 5 additions and 5 deletions

View file

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

View file

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

View file

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

View file

@ -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