1

我正在尝试捕获特定异常,然后手动将其记录到 errbit,然后向用户显示错误消息并重定向它们。

在我的模型中使用下面的代码,我可以出错

# Causes uninitialized constant Issue::Airbrake

如何手动将错误记录到 errbit?我正在使用 Airbrake gem 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
4

1 回答 1

3

我不得不将 Airbrake gem 从我的 Gemfile 中的生产组中移出。

于 2014-06-12T04:50:22.543 回答