Exception: Vanagon::Error

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

Overview

An error class that accepts a wrapped error message

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mesg) ⇒ Error

Returns a new instance of Error.

Parameters:

  • mesg (String)

    The exception mesg



24
25
26
# File 'lib/vanagon/errors.rb', line 24

def initialize(mesg)
  super(mesg)
end

Instance Attribute Details

#originalObject

Returns the value of attribute original.



6
7
8
# File 'lib/vanagon/errors.rb', line 6

def original
  @original
end

Class Method Details

.wrap(original, mesg) ⇒ Vanagon::Error

Generate a wrapped exception

Parameters:

  • original (Exception)

    The exception to wrap

  • mesg (String)

Returns:



14
15
16
17
18
19
# File 'lib/vanagon/errors.rb', line 14

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