mirror of
https://github.com/wiz0u/WTelegramClient.git
synced 2025-12-06 06:52:01 +01:00
Correctly handle RPC Error for methods returning bool.
Also don't hang CallAsync on ReadRpcResult deserializing error
This commit is contained in:
parent
95d9135bd0
commit
f289b9e2e5
|
|
@ -698,6 +698,8 @@ namespace WTelegram
|
|||
var (type, tcs) = PullPendingRequest(msgId);
|
||||
object result;
|
||||
if (tcs != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!type.IsArray)
|
||||
result = reader.ReadTLValue(type);
|
||||
|
|
@ -712,6 +714,12 @@ namespace WTelegram
|
|||
Log(1, "");
|
||||
tcs.SetResult(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
tcs.SetException(ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result = reader.ReadTLObject();
|
||||
|
|
|
|||
Loading…
Reference in a new issue