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, InvalidSource

Instance Attribute Summary collapse

Class Method Summary collapse

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