Module: Hypercuke::Error::ClassMethods

Defined in:
lib/hypercuke/exceptions.rb

Instance Method Summary collapse

Instance Method Details

#translate_message(message) ⇒ Object



15
16
17
# File 'lib/hypercuke/exceptions.rb', line 15

def translate_message(message)
  message # just here to be overridden
end

#wrap(exception) ⇒ Object



8
9
10
11
12
13
# File 'lib/hypercuke/exceptions.rb', line 8

def wrap(exception)
  message = translate_message(exception.message)
  new(message).tap do |wrapping_exception|
    wrapping_exception.set_backtrace exception.backtrace
  end
end