Friendlier exceptions for Auth testing

This change also lets you write the auth code in the
app.config file without the need to recompile/debug.
This commit is contained in:
Andres G. Aragoneses 2016-10-31 00:15:10 +08:00
parent b0b58be25e
commit f062c0a7a1
4 changed files with 32 additions and 2 deletions

View file

@ -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);