From 716bf79cb6b2fe59e22ef84804af97420f061b51 Mon Sep 17 00:00:00 2001 From: Still Hsu <341464@gmail.com> Date: Sat, 1 Sep 2018 00:20:08 +0800 Subject: [PATCH] Change InvalidOperation to ArgumentOoR --- src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs b/src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs index 85b521697..4917f75f9 100644 --- a/src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs +++ b/src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs @@ -77,7 +77,8 @@ namespace Discord.Rest int? maxAge, int? maxUses, bool isTemporary, bool isUnique, RequestOptions options) { if (maxAge.HasValue && maxAge > 86400) - throw new InvalidOperationException("The maximum age of an invite must be less than or equal to a day (86400)."); + throw new ArgumentOutOfRangeException(nameof(maxAge), maxAge, + "The maximum age of an invite must be less than or equal to a day (86400)."); var args = new API.Rest.CreateChannelInviteParams { IsTemporary = isTemporary,