Exception: Vagrant::Actions::ActionException

Inherits:
Exception
  • Object
show all
Defined in:
lib/vagrant/actions/base.rb

Overview

An exception which occured within an action. This should be used instead of error_and_exit, since it allows the Runner to call rescue on all the actions and properly exit. Any message passed into the ActionException is then shown and and vagrant exits.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, data = {}) ⇒ ActionException

Returns a new instance of ActionException.



109
110
111
112
113
114
115
# File 'lib/vagrant/actions/base.rb', line 109

def initialize(key, data = {})
  @key = key
  @data = data

  message = Vagrant::Util::Errors.error_string(key, data)
  super(message)
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



107
108
109
# File 'lib/vagrant/actions/base.rb', line 107

def data
  @data
end

#keyObject (readonly)

Returns the value of attribute key.



106
107
108
# File 'lib/vagrant/actions/base.rb', line 106

def key
  @key
end