class StandardError

Public Instance Methods

airbrake_args() click to toggle source

Shortcut for .send(:notify_or_ignore, *e.airbrake_args)

# File lib/patches/standard_error.rb, line 3
def airbrake_args
  [self, parameters: airbrake_params]
end
airbrake_params() click to toggle source

Default is to report all instance variables to Airbrake.

# File lib/patches/standard_error.rb, line 8
def airbrake_params
  params = {}

  begin
    instance_variables.each do |name|
      params[name.to_s] = instance_variable_get(name).try(:as_json)
    end
  rescue StandardError => e
    # In development or test, complain if this goes wrong.
    # In production, don't crash, omitting params instead.
    # Dear user: If your errors stop showing parameters, this may be why.
    raise e if Rails.env.development?
  end

  params
end