vknet_vk/VkNet/Exception/CaptchaNeededException.cs
Инютин Максим Николаевич 3b145a3327 Рефакторинг проекта
2025-09-09 01:02:47 +03:00

47 lines
No EOL
1.2 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Runtime.Serialization;
using JetBrains.Annotations;
using VkNet.Model;
using VkNet.Utils;
namespace VkNet.Exception;
/// <summary>
/// Исключение, выбрасываемое при необходимости ввода капчи для вызова метода
/// Код ошибки - 14
/// </summary>
[Serializable]
[VkError(VkErrorCode.CaptchaNeeded)]
public sealed class CaptchaNeededException : VkApiMethodInvokeException
{
/// <inheritdoc />
public CaptchaNeededException(VkError response) : base(response)
{
if (response is null)
{
return;
}
Sid = response.CaptchaSid;
Img = response.CaptchaImg;
}
/// <inheritdoc />
private CaptchaNeededException(SerializationInfo serializationInfo, StreamingContext streamingContext) : base(new())
{
}
/// <inheritdoc />
[UsedImplicitly]
public override void GetObjectData(SerializationInfo info, StreamingContext context) => base.GetObjectData(info, context);
/// <summary>
/// Идентификатор капчи
/// </summary>
public ulong Sid { get; }
/// <summary>
/// Uri-адрес изображения с капчей
/// </summary>
public Uri Img { get; }
}