我试图捕获一个特定的异常,然后手动将其记录到errbit,然后向用户显示一条错误消息并重定向它们。
使用下面的代码在我的模型中,我可以错误
# Causes uninitialized constant Issue::Airbrake如何手动将错误记录到errbit?我使用的是空气制动宝石4.0.0版
class Issue < ActiveRecord::Base
after_create :send_email
def send_email
begin
raise StandardError
rescue StandardError => e
# Log error in errbit manually
Airbrake.notify(e) # Causes uninitialized constant Issue::Airbrake
end
end发布于 2014-06-12 04:50:22
我不得不在我的Gemfile中将空气制动宝石从生产组移出。
https://stackoverflow.com/questions/24176411
复制相似问题