зеркало из
https://github.com/glebtv/telegram-bot.git
synced 2026-09-03 17:55:52 +03:00
rescue_from feature
Этот коммит содержится в:
@@ -57,6 +57,7 @@ module Telegram
|
||||
instrumentation
|
||||
log_subscriber
|
||||
reply_helpers
|
||||
rescue
|
||||
session
|
||||
].each { |file| require "telegram/bot/updates_controller/#{file}" }
|
||||
|
||||
@@ -78,6 +79,7 @@ module Telegram
|
||||
end
|
||||
|
||||
include AbstractController::Translation
|
||||
include Rescue
|
||||
include ReplyHelpers
|
||||
prepend Instrumentation
|
||||
extend Session::ConfigMethods
|
||||
|
||||
20
lib/telegram/bot/updates_controller/rescue.rb
Обычный файл
20
lib/telegram/bot/updates_controller/rescue.rb
Обычный файл
@@ -0,0 +1,20 @@
|
||||
require 'active_support/rescuable'
|
||||
|
||||
module Telegram
|
||||
module Bot
|
||||
class UpdatesController
|
||||
module Rescue
|
||||
extend ActiveSupport::Concern
|
||||
include ActiveSupport::Rescuable
|
||||
|
||||
private
|
||||
|
||||
def process_action(*)
|
||||
super
|
||||
rescue Exception => exception # rubocop:disable RescueException
|
||||
rescue_with_handler(exception) || raise
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Ссылка в новой задаче
Block a user