Skip to content
This repository was archived by the owner on Dec 5, 2021. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
a8a82f3
Modifications to Session and TelegramClient to allow a customised Ses…
pp4x Dec 26, 2017
a69db6b
TelegramClient exposes Session as a property so that TLUser can be re…
pp4x Dec 27, 2017
a4a5ae4
First update event attempt.
pp4x Dec 28, 2017
cf98347
Fixed receive only call.
pp4x Dec 28, 2017
017f5dd
undone the 'async' changes.
pp4x Dec 29, 2017
f871597
API modified to receive events instead of relying on polling to updat…
pp4x Jan 2, 2018
7636206
Updated nuget packages
pp4x Jan 3, 2018
42ace63
Update README.md
pp4x Jan 4, 2018
bf20298
Update README.md
pp4x Jan 4, 2018
73022fc
Update README.md
pp4x Jan 4, 2018
936a26c
* HandleUpdate fixed for the case where there are no subscribers.
pp4x Jan 5, 2018
9ad192c
* Adds a CancellationToken to the "event" API so that it can be inter…
pp4x Jan 8, 2018
4ca8b95
Merge branch 'master' of https://github.com/ppanhoto78/TLSharp
pp4x Jan 8, 2018
15163c5
Handles correctly the case of null IdleLoop handler.
pp4x Jan 17, 2018
3f5adeb
Clears idle handlers after they've been processed.
pp4x Feb 14, 2018
ef1f961
Added debug logging to MtProtoSender, so that state machine can be "v…
pp4x Feb 20, 2018
a425d14
Additional log messages.
pp4x Feb 20, 2018
549b831
Instead of relying on a cancellation token, which caused some confusi…
pp4x Feb 22, 2018
083e455
Fixed buffer "sniffer"
pp4x Feb 22, 2018
2c8ea9c
Fixed event waiting with timeout.
pp4x Feb 22, 2018
b71a723
* Added logging messages.
pp4x Feb 22, 2018
f30dc2d
Disconsider ping delay for purpose of next ping message.
pp4x Feb 22, 2018
57b804e
Adds a function to allow the app to terminate a loop and close the cl…
pp4x Feb 27, 2018
aae366d
Captures all network exceptions in a new module.
pp4x Feb 27, 2018
b98914e
Reports exception to logger where it used to go to console only.
pp4x Mar 1, 2018
01e61f3
New flag to mask event reporting. This is necessary so that Initialis…
pp4x Mar 1, 2018
9f25a76
logs exception caught when handling a container message.
pp4x Mar 1, 2018
8b392f5
Rethrows BadMessageExceptions when parsing container messages.
pp4x Mar 1, 2018
4c11208
Adds another callback recurrent timed tasks.
pp4x Mar 1, 2018
8180ee9
sets the _looping flag to true right from the constructor so if Close…
Mar 8, 2018
6836e56
GetUserDialogsAsync() has new parameter offset so that when a dialogs…
Mar 12, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
489 changes: 243 additions & 246 deletions README.md

Large diffs are not rendered by default.

69 changes: 69 additions & 0 deletions TLSharp.Core/Network/Exceptions.cs
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)
{
}
}


}
Loading