Exception: MobyBase::MobyCustomError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/tdriver/base/errors.rb

Overview

TODO: document

Direct Known Subclasses

BehaviourError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = "") ⇒ MobyCustomError

Returns a new instance of MobyCustomError.



114
115
116
117
118
119
120
121
# File 'lib/tdriver/base/errors.rb', line 114

def initialize( message = "" )
	# get backtrace from error
	tmp_trace = ( ( $!.nil? ) ? [] : $!.backtrace ) 
	# add caller method to backtrace
	set_backtrace( ( ( caller( 2 ).nil? ) ? tmp_trace : tmp_trace.unshift( caller( 2 ).first[ /(.+):in/, 1 ] ) ) )
	@message = message << ( $!.nil? ? "" : ". Exception: #{ $!.message }" )
	super
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



113
114
115
# File 'lib/tdriver/base/errors.rb', line 113

def message
  @message
end