From feef559baef949f20a16fe8835ab574704b51c12 Mon Sep 17 00:00:00 2001 From: xiadosw <41824249+xiadosw@users.noreply.github.com> Date: Wed, 28 Aug 2024 13:55:57 +0300 Subject: [PATCH] Added TooManyFriendsException (#1619) (#1620) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Список изменений - Добавлен TooManyFriendsException --- VkNet/Exception/TooManyFriendsException.cs | 26 ++++++++++++++++++++++ VkNet/Utils/VkErrorCode.cs | 5 +++++ 2 files changed, 31 insertions(+) create mode 100644 VkNet/Exception/TooManyFriendsException.cs diff --git a/VkNet/Exception/TooManyFriendsException.cs b/VkNet/Exception/TooManyFriendsException.cs new file mode 100644 index 000000000..710e343ba --- /dev/null +++ b/VkNet/Exception/TooManyFriendsException.cs @@ -0,0 +1,26 @@ +using System; +using System.Runtime.Serialization; +using VkNet.Model; +using VkNet.Utils; + +namespace VkNet.Exception; + +/// +/// Исключение, которое выбрасывается при превышении лимита друзей. +/// Код ошибки - 242 +/// +[Serializable] +[VkError(VkErrorCode.TooManyFriends)] +public sealed class TooManyFriendsException : VkApiMethodInvokeException +{ + /// + public TooManyFriendsException(VkError response) : base(response) + { + } + + /// + private TooManyFriendsException(SerializationInfo serializationInfo, StreamingContext streamingContext) : base(new()) + { + + } +} \ No newline at end of file diff --git a/VkNet/Utils/VkErrorCode.cs b/VkNet/Utils/VkErrorCode.cs index 24b64687e..d6865b428 100644 --- a/VkNet/Utils/VkErrorCode.cs +++ b/VkNet/Utils/VkErrorCode.cs @@ -368,6 +368,11 @@ public static class VkErrorCode /// public const int TooManyAdsPosts = 224; + /// + /// Превышен лимит друзей + /// + public const int TooManyFriends = 242; + /// /// Доступ к списку групп запрещен из-за настроек конфиденциальности пользователя. ///