mirror of
https://github.com/wiz0u/WTelegramClient.git
synced 2025-12-06 06:52:01 +01:00
Notify ReactorError before (not after) throwing exception on pending APIs
This commit is contained in:
parent
000c35b256
commit
5743942a7f
3
FAQ.md
3
FAQ.md
|
|
@ -191,7 +191,8 @@ If Telegram servers decide to shutdown this secondary connection, it's not an is
|
||||||
This should be transparent and pending API calls should automatically be resent upon reconnection.
|
This should be transparent and pending API calls should automatically be resent upon reconnection.
|
||||||
You can choose to increase `MaxAutoReconnects` if it happens too often because your Internet connection is unstable.
|
You can choose to increase `MaxAutoReconnects` if it happens too often because your Internet connection is unstable.
|
||||||
|
|
||||||
3) If you reach `MaxAutoReconnects` disconnections, then the **Update** event handler will receive a `ReactorError` object to notify you of the problem.
|
3) If you reach `MaxAutoReconnects` disconnections, then the **Update** event handler will receive a `ReactorError` object to notify you of the problem,
|
||||||
|
and pending API calls throw the network IOException.
|
||||||
In this case, the recommended action would be to dispose the client and recreate one
|
In this case, the recommended action would be to dispose the client and recreate one
|
||||||
|
|
||||||
4) In case of slow Internet connection or if you break in the debugger for some time,
|
4) In case of slow Internet connection or if you break in the debugger for some time,
|
||||||
|
|
|
||||||
|
|
@ -329,6 +329,7 @@ namespace WTelegram
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
OnUpdate(reactorError);
|
||||||
lock (_pendingRpcs) // abort all pending requests
|
lock (_pendingRpcs) // abort all pending requests
|
||||||
{
|
{
|
||||||
foreach (var rpc in _pendingRpcs.Values)
|
foreach (var rpc in _pendingRpcs.Values)
|
||||||
|
|
@ -336,7 +337,6 @@ namespace WTelegram
|
||||||
_pendingRpcs.Clear();
|
_pendingRpcs.Clear();
|
||||||
_bareRpc = null;
|
_bareRpc = null;
|
||||||
}
|
}
|
||||||
OnUpdate(reactorError);
|
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue