Exception: Kitchen::StandardError

Inherits:
StandardError
  • Object
show all
Includes:
Error
Defined in:
lib/kitchen/errors.rb

Overview

Base exception class from which all Kitchen exceptions derive. This class nests an exception when this class is re-raised from a rescue block.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Error

formatted_backtrace, formatted_exception, formatted_trace

Constructor Details

#initialize(msg, original = $ERROR_INFO) ⇒ StandardError

Creates a new StandardError exception which optionally wraps an original exception if given or detected by checking the ‘$!` global variable.

Parameters:

  • msg (String)

    exception message

  • original (::StandardError) (defaults to: $ERROR_INFO)

    an original exception which will be wrapped (default: ‘$ERROR_INFO`)



113
114
115
116
# File 'lib/kitchen/errors.rb', line 113

def initialize(msg, original = $ERROR_INFO)
  super(msg)
  @original = original
end

Instance Attribute Details

#original::StandardError (readonly)

Returns the original (wrapped) exception.

Returns:

  • (::StandardError)

    the original (wrapped) exception



105
106
107
# File 'lib/kitchen/errors.rb', line 105

def original
  @original
end