PaulSonOfLars / gotgbot

Autogenerated Go wrapper for the telegram API. Inspired by the python-telegram-bot library.
MIT License
509 stars 115 forks source link

Improve panic handling #36

Closed PaulSonOfLars closed 2 years ago

PaulSonOfLars commented 3 years ago

What

debug.Stack() should not be passed to d.Panic(), as this could be a performance bottleneck. If necessary, it can be called in the d.Panic() call itself with the same result. Instead, pass the returned value r of the recovery, to propagate the reason for the panic.

Similarly, if no panic handling is defined, print the r value to allow for better debug messages.

Suggested here: https://t.me/GotgbotChat/6370

Impact