Closed mario-amazing closed 1 year ago
You can implement it the similar way: https://github.com/telegram-bot-rb/telegram-bot/issues/201#issuecomment-1454146574
I don't think will add a plugin for the bot poller similar to the one they have for rails controller 😉
I think the issue in the Logger inside the bot poller If you have another vision of why the behavior above could be, explain it, please)
https://github.com/getsentry/sentry-ruby/blob/master/sentry-rails/lib/sentry/rails/railtie.rb#L10 this is where sentry installs plugin into action_controller.
Obviously it doesn't install such plugin for telegram bot poller. So you can either ask them for such plugin or implement it yourself. With a link I provided in the previous comment you can wrap super
call with a code that will capture exception and send it to sentry. It will be something like this: https://github.com/getsentry/sentry-ruby/blob/803ba7394bc8301bec7c3de6c78c4b019214eb8f/sentry-ruby/lib/sentry/rack/capture_exceptions.rb#L12
In poller mode, the bot doesn't send raise_error to sentry. (OR rewrites logs somehow)
LOG_TO_STDOUT
doesn't help Bot sends only [OpenSSL::SSL::SSLError
] error.Expected behavior: same as with
rails s
->webhook mode
. Sends all errors to sentryGemfile:
config/initializers/sentry.rb