mirror of
https://github.com/sochix/TLSharp.git
synced 2026-04-05 14:37:04 +00:00
Merge pull request #277 from knocte/friendlerAuthTestFailures
Friendlier exceptions for Auth testing
This commit is contained in:
commit
24a9ea1ed9
4 changed files with 32 additions and 2 deletions
|
|
@ -293,6 +293,10 @@ namespace TLSharp.Core.Network
|
|||
var dcIdx = int.Parse(resultString);
|
||||
throw new UserMigrationException(dcIdx);
|
||||
}
|
||||
else if (errorMessage == "PHONE_CODE_INVALID")
|
||||
{
|
||||
throw new InvalidPhoneCodeException("The numeric code used to authenticate does not match the numeric code sent by SMS/Telegram");
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidOperationException(errorMessage);
|
||||
|
|
|
|||
|
|
@ -310,4 +310,9 @@ namespace TLSharp.Core
|
|||
{
|
||||
}
|
||||
}
|
||||
|
||||
public class InvalidPhoneCodeException : Exception
|
||||
{
|
||||
internal InvalidPhoneCodeException(string msg) : base(msg) { }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue