Class: Bugsage::ExceptionsApp

Inherits:
Object
  • Object
show all
Defined in:
lib/bugsage/exceptions_app.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.call(env) ⇒ Object



5
6
7
# File 'lib/bugsage/exceptions_app.rb', line 5

def self.call(env)
  new.call(env)
end

Instance Method Details

#call(env) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/bugsage/exceptions_app.rb', line 9

def call(env)
  config = Bugsage.configuration

  if config.enabled? && config.show_error_page?
    rendered = ExceptionHandler.render_response(env)
    return rendered if rendered
  elsif config.enabled? && config.capture_errors?
    ExceptionHandler.store_exception(env)
  end

  fallback_response(env)
end