Bring back report message to Migration exceptions

When refactoring recently the PHONE_MIGRATE_X error
wrt exception handling [1] I removed the dubious/obsolete
"settings" part, but I mistakenly removed the URL which
tells library consumers that if they face this exception,
it's actually a bug of the library that they should report.

[1] 77867b44e6
This commit is contained in:
Andres G. Aragoneses 2016-10-30 16:16:55 +08:00
parent a521466bb0
commit e1ff4bb75b
2 changed files with 9 additions and 6 deletions

View file

@ -203,9 +203,9 @@ Contributing is highly appreciated!
#### What API layer is supported? #### What API layer is supported?
The latest one - 57. Thanks to Afshin Arani for his TLGenerator The latest one - 57. Thanks to Afshin Arani for his TLGenerator
#### I get an error MIGRATE_X? #### I get a xxxMigrationException or a MIGRATE_X error!
TLSharp library should automatically handle this errors. If you see such errors, pls create a new issue. TLSharp library should automatically handle these errors. If you see such errors, please open a new Github issue with the details (include a stacktrace, etc.).
#### I get an exception: System.IO.EndOfStreamException: Unable to read beyond the end of the stream. All test methos except that AuthenticationWorks and TestConnection return same error. I did every thing including setting api id and hash, and setting server address.- #### I get an exception: System.IO.EndOfStreamException: Unable to read beyond the end of the stream. All test methos except that AuthenticationWorks and TestConnection return same error. I did every thing including setting api id and hash, and setting server address.-

View file

@ -499,7 +499,10 @@ namespace TLSharp.Core.Network
{ {
internal int DC { get; private set; } internal int DC { get; private set; }
protected DataCenterMigrationException(string msg, int dc) : base (msg) private const string REPORT_MESSAGE =
" See: https://github.com/sochix/TLSharp#i-get-an-error-migrate_x";
protected DataCenterMigrationException(string msg, int dc) : base (msg + REPORT_MESSAGE)
{ {
DC = dc; DC = dc;
} }
@ -508,7 +511,7 @@ namespace TLSharp.Core.Network
internal class PhoneMigrationException : DataCenterMigrationException internal class PhoneMigrationException : DataCenterMigrationException
{ {
internal PhoneMigrationException(int dc) internal PhoneMigrationException(int dc)
: base ($"Your phone number is registered to a different DC: {dc}. Please migrate.", dc) : base ($"Phone number registered to a different DC: {dc}.", dc)
{ {
} }
} }
@ -516,7 +519,7 @@ namespace TLSharp.Core.Network
internal class FileMigrationException : DataCenterMigrationException internal class FileMigrationException : DataCenterMigrationException
{ {
internal FileMigrationException(int dc) internal FileMigrationException(int dc)
: base ($"File is located on a different DC: {dc}. Please migrate.", dc) : base ($"File located on a different DC: {dc}.", dc)
{ {
} }
} }
@ -524,7 +527,7 @@ namespace TLSharp.Core.Network
internal class UserMigrationException : DataCenterMigrationException internal class UserMigrationException : DataCenterMigrationException
{ {
internal UserMigrationException(int dc) internal UserMigrationException(int dc)
: base($"User is located on a different DC: {dc}. Please migrate.", dc) : base($"User located on a different DC: {dc}.", dc)
{ {
} }
} }