Class: JavascriptExceptionHandler::MainController

Inherits:
ActionController::Metal
  • Object
show all
Defined in:
app/controllers/javascript_exception_handler/main_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



5
6
7
8
9
10
11
12
# File 'app/controllers/javascript_exception_handler/main_controller.rb', line 5

def index
  self.response_body = params.to_s
  if 'ExceptionNotifier'.safe_constantize
    ExceptionNotifier::Notifier.background_exception_notification(Exception.new('Js Exception'), params).deliver
  elsif 'Bugsnag'.safe_constantize 
    Bugsnag.notify(Exception.new('Js Exception'), params)
  end
end