Exception: FrontendRescue::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/frontend_rescue/error.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, user_agent, message, trace, params) ⇒ Error

Returns a new instance of Error.



3
4
5
6
7
8
# File 'lib/frontend_rescue/error.rb', line 3

def initialize(name, user_agent, message, trace, params)
  @trace = trace.split("\n") rescue []
  @user_agent = user_agent
  @params = params || {}
  super "Uncaught #{name} Error: #{message}"
end

Instance Method Details

#backtraceObject



10
11
12
13
14
# File 'lib/frontend_rescue/error.rb', line 10

def backtrace
  ["User Agent: #{user_agent}"] +
  @params.map{|k, v| "#{k}: #{v}"} +
  @trace
end

#user_agentObject



16
17
18
# File 'lib/frontend_rescue/error.rb', line 16

def user_agent
  @user_agent
end