sochix / TLSharp

Telegram client library implemented in C#
1k stars 379 forks source link

Exception happened when caption length more than 200 character #450

Open omarmaher100 opened 7 years ago

omarmaher100 commented 7 years ago

if caption string more than 200 character you will get Exception and you can find this in https://core.telegram.org/bots/api i fixed it her in this pull request https://github.com/sochix/TLSharp/pull/449

knocte commented 7 years ago

Can you please copy paste the whole exception.ToString() here?

omarmaher100 commented 7 years ago

Sure and according to the documentation the maximum length is 200 so i got this exception when the length of caption more than 200 char and as i mentioned i solved it by this pull request https://github.com/sochix/TLSharp/pull/449

Exception Message : MEDIA_CAPTION_TOO_LONG

Exception Description : at TLSharp.Core.Network.MtProtoSender.HandleRpcResult(UInt64 messageId, Int32 sequence, BinaryReader messageReader, TLMethod request) inTLSharp-master\TLSharp-master\TLSharp.Core\Network\MtProtoSender.cs:line 318 at TLSharp.Core.Network.MtProtoSender.processMessage(UInt64 messageId, Int32 sequence, BinaryReader messageReader, TLMethod request) in TLSharp-master\TLSharp-master\TLSharp.Core\Network\MtProtoSender.cs:line 206 at TLSharp.Core.Network.MtProtoSender.d9.MoveNext() in TLSharp-master\TLSharp-master\TLSharp.Core\Network\MtProtoSender.cs:line 144 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at TLSharp.Core.TelegramClient.d171.MoveNext() in TLSharp-master\TLSharp-master\TLSharp.Core\TelegramClient.cs:line 214 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at TLSharp.Core.TelegramClient.d22.MoveNext() in TLSharp-master\TLSharp-master\TLSharp.Core\TelegramClient.cs:line 265 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at TLSharp.Tests.TLSharpTests.d54.MoveNext() in TLSharp-master\TLSharp-master\TLSharp.Tests\TLSharpTests.cs:line 325 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at Arcom.WinService.SocialMedia.SocialMedia.d27.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at Arcom.WinService.SocialMedia.SocialMedia.d24.MoveNext() in --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at Arcom.WinService.SocialMedia.SocialMedia.d__23.MoveNext() in Exception Source : TLSharp.Core

Exception InnerException :

Exception Data : System.Collections.ListDictionaryInternal

Exception HelpLink :

Exception Method : Boolean HandleRpcResult(UInt64, Int32, System.IO.BinaryReader, TeleSharp.TL.TLMethod) End exception

knocte commented 7 years ago

Thanks Omar. Let's discuss now on the PR.