Exception: Salt::Matrix::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/salt/matrix/error.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mesg, options = {}) ⇒ Error

Returns a new instance of Error.



18
19
20
21
22
23
24
25
26
27
# File 'lib/salt/matrix/error.rb', line 18

def initialize(mesg, options = {})
  super(mesg)

  bt = options.delete(:backtrace)
  if bt
    set_backtrace(bt)
  end

  @options = options
end

Instance Attribute Details

#originalObject

Returns the value of attribute original.



8
9
10
# File 'lib/salt/matrix/error.rb', line 8

def original
  @original
end

Class Method Details

.wrap(original, mesg, options = {}) ⇒ Object



10
11
12
13
14
15
# File 'lib/salt/matrix/error.rb', line 10

def self.wrap(original, mesg, options = {})
  new(mesg, options).tap do |e|
    e.set_backtrace(caller(4))
    e.original = original
  end
end