Class: Gizmo::ExceptionHandling

Inherits:
Object
  • Object
show all
Includes:
Aquarium::DSL
Defined in:
lib/gizmo/aop/exception_handling.rb

Class Method Summary collapse

Class Method Details

.log_error(error) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/gizmo/aop/exception_handling.rb', line 7

def self.log_error(error)
  puts "ERROR:: #{error.message}: #{error.backtrace}"

  if defined?(Rails) && Rails.logger
    Rails.logger.error "#{error.message}: #{error.backtrace}"
  end
end