Module: Ramda::ExceptionHandler

Defined in:
lib/ramda/exception_handler.rb

Overview

Exception Handlers

Class Method Summary collapse

Class Method Details

.default(e) ⇒ Object

This handler follows a standard behavior.

Raises:

  • (e)


18
19
20
# File 'lib/ramda/exception_handler.rb', line 18

def self.default(e, *)
  raise e, e.exception, e.backtrace
end

.with_narrow(e, method_name) ⇒ Object

This handler is useful for debug.

Output example: compose -> map -> add -> … original message … with backtrace: … original backtrace …

Raises:

  • (e)


12
13
14
# File 'lib/ramda/exception_handler.rb', line 12

def self.with_narrow(e, method_name)
  raise e, [method_name, e.exception].join(' -> '), e.backtrace
end