Exception: Cucumber::Wire::Exception

Inherits:
StandardError
  • Object
show all
Defined in:
lib/cucumber/wire/exception.rb

Overview

Proxy for an exception that occurred at the remote end of the wire

Defined Under Namespace

Modules: CanSetName

Instance Method Summary collapse

Constructor Details

#initialize(args, config) ⇒ Exception

Returns a new instance of Exception.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/cucumber/wire/exception.rb', line 15

def initialize(args, config)
  super(args['message'])

  if args['exception']
    self.class.extend(CanSetName)
    self.class.exception_name = "#{args['exception']} from #{config}"
  end

  return unless args['backtrace']

  @backtrace = if args['backtrace'].is_a?(String)
                 args['backtrace'].split("\n") # TODO: change cuke4nuke to pass an array instead of a big string
               else
                 args['backtrace']
               end
end

Instance Method Details

#backtraceObject



32
33
34
# File 'lib/cucumber/wire/exception.rb', line 32

def backtrace
  @backtrace || super
end