Exception: Vanagon::Error

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

Overview

An error class that accepts a wrapped error message

Direct Known Subclasses

GitError

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



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

def initialize(mesg)
  super(mesg)
end

Instance Attribute Details

#originalObject

Returns the value of attribute original.



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

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:



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

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