-
-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #208 from digitallez/master
Добавлена обработка ошибки NeedValidation
- Loading branch information
Showing
3 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
namespace VkNet.Exception | ||
{ | ||
using System; | ||
using System.Runtime.Serialization; | ||
|
||
using Enums.Filters; | ||
|
||
/// <summary> | ||
/// Исключение, которое выбрасывается в случаях, | ||
/// когда требуется дополнительная проверка пользователя, | ||
/// например при авторизации из подозрительного места | ||
/// | ||
/// В этом случае необходимо открыть браузер со страницей, указанной в поле redirect_uri и ждать, | ||
/// пока пользователь будет направлен на страницу blank.html с параметром success=1 в случае успеха и fail=1 | ||
/// в случае, если пользователь отменил проверку своего аккаунта. | ||
/// Для тестового вызова проверки добавьте параметр test_redirect_uri=1. | ||
/// | ||
/// </summary> | ||
[Serializable] | ||
public class NeedValidationException : VkApiException | ||
{ | ||
/// <summary> | ||
/// Адрес который необходимо открыть в браузере. | ||
/// </summary> | ||
public Uri redirectUri { get; private set; } | ||
|
||
|
||
/// <summary> | ||
/// Инициализирует новый экземпляр класса <see cref="VkApiAuthorizationException"/>. | ||
/// </summary> | ||
/// <param name="message">Описание исключения.</param> | ||
/// <param name="strRedirectUri">Адрес который необходимо открыть в браузере.</param> | ||
public NeedValidationException(string message, string strRedirectUri) : base(message) | ||
{ | ||
redirectUri = new Uri(strRedirectUri); | ||
} | ||
|
||
|
||
/// <summary> | ||
/// Инициализирует новый экземпляр класса <see cref="AccessTokenInvalidException"/> на основе ранее сериализованных данных. | ||
/// </summary> | ||
/// <param name="info">Содержит все данные, необходимые для десериализации.</param> | ||
/// <param name="context">Описывает источник и назначение данного сериализованного потока и предоставляет дополнительный, | ||
/// определяемый вызывающим, контекст.</param> | ||
protected NeedValidationException(SerializationInfo info, StreamingContext context) : base(info, context) | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters