Browse Source

Change InvalidOperation to ArgumentOoR

pull/1140/head
Still Hsu 7 years ago
parent
commit
716bf79cb6
No known key found for this signature in database GPG Key ID: 8601A145FDA95209
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs

+ 2
- 1
src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs View File

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


Loading…
Cancel
Save