This repository has been archived by the owner on Dec 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pr updates amended pr review changes resolved merge conflicts updates from last night before rebase update on message test now passing removed nlog references and usage resolve conflicts from HEAD Reapply Events PR #679 update on message test now passing removed nlog references and usage
- Loading branch information
1 parent
bca8bc5
commit 3e0e53b
Showing
11 changed files
with
673 additions
and
54 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
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,69 @@ | ||
using System; | ||
namespace TLSharp.Core.Network | ||
{ | ||
public class FloodException : Exception | ||
{ | ||
public TimeSpan TimeToWait { get; private set; } | ||
|
||
internal FloodException(TimeSpan timeToWait) | ||
: base($"Flood prevention. Telegram now requires your program to do requests again only after {timeToWait.TotalSeconds} seconds have passed ({nameof(TimeToWait)} property)." + | ||
" If you think the culprit of this problem may lie in TLSharp's implementation, open a Github issue please.") | ||
{ | ||
TimeToWait = timeToWait; | ||
} | ||
} | ||
|
||
public class BadMessageException : Exception | ||
{ | ||
internal BadMessageException(string description) : base(description) | ||
{ | ||
} | ||
} | ||
|
||
internal abstract class DataCenterMigrationException : Exception | ||
{ | ||
internal int DC { get; private set; } | ||
|
||
private const string REPORT_MESSAGE = | ||
" See: https://github.com/sochix/TLSharp#i-get-a-xxxmigrationexception-or-a-migrate_x-error"; | ||
|
||
protected DataCenterMigrationException(string msg, int dc) : base(msg + REPORT_MESSAGE) | ||
{ | ||
DC = dc; | ||
} | ||
} | ||
|
||
internal class PhoneMigrationException : DataCenterMigrationException | ||
{ | ||
internal PhoneMigrationException(int dc) | ||
: base($"Phone number registered to a different DC: {dc}.", dc) | ||
{ | ||
} | ||
} | ||
|
||
internal class FileMigrationException : DataCenterMigrationException | ||
{ | ||
internal FileMigrationException(int dc) | ||
: base($"File located on a different DC: {dc}.", dc) | ||
{ | ||
} | ||
} | ||
|
||
internal class UserMigrationException : DataCenterMigrationException | ||
{ | ||
internal UserMigrationException(int dc) | ||
: base($"User located on a different DC: {dc}.", dc) | ||
{ | ||
} | ||
} | ||
|
||
internal class NetworkMigrationException : DataCenterMigrationException | ||
{ | ||
internal NetworkMigrationException(int dc) | ||
: base($"Network located on a different DC: {dc}.", dc) | ||
{ | ||
} | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.