Class: VagrantPlugins::Brightbox::Errors::FogError
- Inherits:
-
VagrantBrightboxError
- Object
- Vagrant::Errors::VagrantError
- VagrantBrightboxError
- VagrantPlugins::Brightbox::Errors::FogError
- Defined in:
- lib/vagrant-brightbox/errors.rb
Instance Method Summary collapse
-
#initialize(message = nil, *args) ⇒ FogError
constructor
A new instance of FogError.
Constructor Details
#initialize(message = nil, *args) ⇒ FogError
Returns a new instance of FogError.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/vagrant-brightbox/errors.rb', line 11 def initialize( = nil, *args) if .is_a?(Hash) target = [:message] if target.respond_to?(:body) decode = Fog::JSON.decode(target.body) if decode["errors"] [:message] = decode["error_name"]+":\n"+decode["errors"].join("\n") elsif decode["error_description"] [:message] = decode["error"] + ": " + decode["error_description"] end end end super end |