Exception: Puppet::ModuleTool::Errors::InvalidModuleError Private

Inherits:
ModuleToolError show all
Defined in:
lib/puppet/module_tool/errors/shared.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary

Attributes inherited from Error

#original

Instance Method Summary collapse

Methods inherited from ModuleToolError

#v, #vstring

Constructor Details

#initialize(name, options) ⇒ InvalidModuleError

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of InvalidModuleError.



213
214
215
216
217
218
# File 'lib/puppet/module_tool/errors/shared.rb', line 213

def initialize(name, options)
  @name   = name
  @action = options[:action]
  @error  = options[:error]
  super _("Could not %{action} '%{module_name}'; %{error}") % { action: @action, module_name: @name, error: @error.message }
end

Instance Method Details

#multilineObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



220
221
222
223
224
225
226
# File 'lib/puppet/module_tool/errors/shared.rb', line 220

def multiline
  message = []
  message << _("Could not %{action} module '%{module_name}'") % { action: @action, module_name: @name }
  message << _("  Failure trying to parse metadata")
  message << _("    Original message was: %{message}") % { message: @error.message }
  message.join("\n")
end