Closed 2steuer closed 8 years ago
Can you send the InnerException?
This is the information mono reveals:
Inner: Telegram.Bot.Types.ApiRequestException: Exception of type 'Telegram.Bot.Types.ApiRequestException' was thrown.
at Telegram.Bot.Api+
Or even a little more... Talking about exceptions, Mono is not that helpful...
[07.01.2016 - 13:47:45.167/Error] (SYSTEM/CRITICAL) Exception: System.AggregateException / One or more errors occurred.
at System.Threading.Tasks.Task.ThrowIfExceptional (Boolean includeTaskCanceledExceptions) <0xb5490670 + 0x00049> in <filename unknown>:0
at System.Threading.Tasks.Task`1[TResult].GetResultCore (Boolean waitCompletionNotification) <0xb547df90 + 0x00077> in <filename unknown>:0
at System.Threading.Tasks.Task`1[TResult].get_Result () <0xb547df10 + 0x00035> in <filename unknown>:0
at AlarmSystem.Plugin.Telegram.TelegramHandler.GetMe () <0xb410ac10 + 0x00023> in <filename unknown>:0
at AlarmSystem.Plugin.Telegram.TelegramHandler.Start () <0xb410aae0 + 0x00013> in <filename unknown>:0
at AlarmSystem.AlarmSystemService.OnStart (System.String[] args) <0xb7175728 + 0x017ea> in <filename unknown>:0 . Inner: Telegram.Bot.Types.ApiRequestException: Exception of type 'Telegram.Bot.Types.ApiRequestException' was thrown.
at Telegram.Bot.Api+<SendWebRequest>d__45`1[T].MoveNext () <0xb410b088 + 0x012cf> in <filename unknown>:0
Unhandled Exception:
System.AggregateException: One or more errors occurred. ---> Telegram.Bot.Types.ApiRequestException: Exception of type 'Telegram.Bot.Types.ApiRequestException' was thrown.
at Telegram.Bot.Api+<SendWebRequest>d__45`1[T].MoveNext () <0xb410b088 + 0x012cf> in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional (Boolean includeTaskCanceledExceptions) <0xb5490670 + 0x00049> in <filename unknown>:0
at System.Threading.Tasks.Task`1[TResult].GetResultCore (Boolean waitCompletionNotification) <0xb547df90 + 0x00077> in <filename unknown>:0
at System.Threading.Tasks.Task`1[TResult].get_Result () <0xb547df10 + 0x00035> in <filename unknown>:0
at AlarmSystem.Plugin.Telegram.TelegramHandler.GetMe () <0xb410ac10 + 0x00023> in <filename unknown>:0
at AlarmSystem.Plugin.Telegram.TelegramHandler.Start () <0xb410aae0 + 0x00013> in <filename unknown>:0
at AlarmSystem.AlarmSystemService.OnStart (System.String[] args) <0xb7175728 + 0x017ea> in <filename unknown>:0
---> (Inner Exception #0) Telegram.Bot.Types.ApiRequestException: Exception of type 'Telegram.Bot.Types.ApiRequestException' was thrown.
at Telegram.Bot.Api+<SendWebRequest>d__45`1[T].MoveNext () <0xb410b088 + 0x012cf> in <filename unknown>:0 <---
[ERROR] FATAL UNHANDLED EXCEPTION: System.AggregateException: One or more errors occurred. ---> Telegram.Bot.Types.ApiRequestException: Exception of type 'Telegram.Bot.Types.ApiRequestException' was thrown.
at Telegram.Bot.Api+<SendWebRequest>d__45`1[T].MoveNext () <0xb410b088 + 0x012cf> in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional (Boolean includeTaskCanceledExceptions) <0xb5490670 + 0x00049> in <filename unknown>:0
at System.Threading.Tasks.Task`1[TResult].GetResultCore (Boolean waitCompletionNotification) <0xb547df90 + 0x00077> in <filename unknown>:0
at System.Threading.Tasks.Task`1[TResult].get_Result () <0xb547df10 + 0x00035> in <filename unknown>:0
at AlarmSystem.Plugin.Telegram.TelegramHandler.GetMe () <0xb410ac10 + 0x00023> in <filename unknown>:0
at AlarmSystem.Plugin.Telegram.TelegramHandler.Start () <0xb410aae0 + 0x00013> in <filename unknown>:0
at AlarmSystem.AlarmSystemService.OnStart (System.String[] args) <0xb7175728 + 0x017ea> in <filename unknown>:0
---> (Inner Exception #0) Telegram.Bot.Types.ApiRequestException: Exception of type 'Telegram.Bot.Types.ApiRequestException' was thrown.
at Telegram.Bot.Api+<SendWebRequest>d__45`1[T].MoveNext () <0xb410b088 + 0x012cf> in <filename unknown>:0 <---
Additionally, after updating to the new version yesterday, i got System.IO.FileNotFoundExceptions for System.Net.Http and System.Net.Http.Formatting. I fixed these by ticking "Local copy" to True in the properties dialog of the referecnes.
Maybe this helps?
can you put something like the following around the problematic code:
try {
//your code
} catch (AggregateException e) {
throw e.InnerException;
}
This is whats being thrown:
Unhandled Exception:
Telegram.Bot.Types.ApiRequestException: Exception of type 'Telegram.Bot.Types.ApiRequestException' was thrown.
at AlarmSystem.Plugin.Telegram.TelegramHandler.Start () <0xb407f998 + 0x0007f> in
Fixed by building from source. No idea what the problem was, but you could please check you NuGET Package :-) Also, I noticed quite a lot of dependencies in NuGET, while only WebApi and JSON Serializer are needed. When building from source one can safely delete those dependencies.
i changed to the new project type, so now there should be dependencies per platform...
hi i am using this telegram bot , when more then 1 user using my bot synchronous, the message send to another user , how can i use this telegram bot in threading mode thanks
Hi,
Since yesterday everythin worked fine, but now i always get the following exception von GetMe or GetUpdates. Using Telegram.bot under mono 4.
Can someone help? :-(