Sha256: 195dc98ae9a5dc18cfc0e073a162a3fa348c4a3ee0858d8dd2f81a832d0f238d
Contents?: true
Size: 963 Bytes
Versions: 4
Compression:
Stored size: 963 Bytes
Contents
module Hypercuke module Error def self.included(receiver) receiver.extend ClassMethods end module ClassMethods def wrap(exception) message = translate_message(exception.message) new(message).tap do |wrapping_exception| wrapping_exception.set_backtrace exception.backtrace end end def translate_message(message) message # just here to be overridden end end end class LayerNotDefinedError < NameError include Hypercuke::Error end class TopicNotDefinedError < NameError include Hypercuke::Error end class StepAdapterNotDefinedError < NameError include Hypercuke::Error def self.translate_message(message) step_adapter_name = if md = /(Hypercuke::StepAdapters::\S*)/.match(message) md.captures.first else message end "Step adapter not defined: '#{step_adapter_name}'" end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
hypercuke-0.5.2 | lib/hypercuke/exceptions.rb |
hypercuke-0.5.1 | lib/hypercuke/exceptions.rb |
hypercuke-0.5.0 | lib/hypercuke/exceptions.rb |
hypercuke-0.4.1 | lib/hypercuke/exceptions.rb |