Class: Exceptional::RackExceptionData

Inherits:
ExceptionData show all
Defined in:
lib/exceptional/rack_exception_data.rb

Instance Method Summary collapse

Methods inherited from ExceptionData

#context_stuff, #extract_http_headers, sanitize_hash, sanitize_session, #to_hash, #to_json, #uniqueness_hash

Constructor Details

#initialize(exception, environment, request) ⇒ RackExceptionData

Returns a new instance of RackExceptionData.



5
6
7
8
9
# File 'lib/exceptional/rack_exception_data.rb', line 5

def initialize(exception, environment, request)
  super(exception)                  
  @environment = environment
  @request = request
end

Instance Method Details

#extra_stuffObject



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/exceptional/rack_exception_data.rb', line 15

def extra_stuff
  return {} if @request.nil?
  {
    'request' => {
      'url' => "#{@request.url}",                       
      'parameters' => @request.params,
      'request_method' => @request.request_method.to_s,
      'remote_ip' => @request.ip,
      'headers' => extract_http_headers(@environment),
      'session' => self.class.sanitize_session(@request)
    }
  }
end

#frameworkObject



11
12
13
# File 'lib/exceptional/rack_exception_data.rb', line 11

def framework
  "rack"
end