Open rutsky opened 7 years ago
@hryamzik: looks like update.Message
should be checked for nil
at main.go:88
.
We can check it for nil
but what should we do? If token is invalid there's no reason to run.
what should we do?
Do. Not. Crash. :)
If token is invalid there's no reason to run.
Well, if configuration is incorrect it should be handled and reported (probably with message and service exit with non-zero code).
BTW, bot token hasn't changed between described here failure and successful usage in the following runs, so I don't think this error is caused by incorrect bot access token.
@leominov because you can ask bot for chat ID.
@rutsky I believe crash results in non-zero exit code. PRs are welcomed. ;-)
I'm trying prometheus_bot from master branch (271ff171) compiled with Go 1.6.2 from Ubuntu 16.04 64-bit and have observed panic during handling of first requests with newly created Telegram bot.
I can't reproduce this issue currently and I believe the issue is related to freshly created Telegram bot or some issue on Telegram side. I want to leave this issue here for the reference, in case anyone else will observe it later.
Here is what I've done.
./prometheus_bot -c config.yml
make test
without specification ofTELEGRAM_CHATID
:This lead to 404 responses from
prometheus_bot
.TELEGRAM_CHATID
:This lead to panic. Here is prometheus_bot log for the whole session: