Exception: Puppet::Forge::Errors::ResponseError
- Inherits:
-
ForgeError
- Object
- RuntimeError
- Error
- ForgeError
- Puppet::Forge::Errors::ResponseError
- Defined in:
- lib/puppet/forge/errors.rb
Overview
This exception is raised when there is a bad HTTP response from the forge and optionally a message in the response.
Instance Attribute Summary
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(options) ⇒ ResponseError
constructor
A new instance of ResponseError.
-
#multiline ⇒ String
Return a multiline version of the error message.
Constructor Details
#initialize(options) ⇒ ResponseError
Returns a new instance of ResponseError.
76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/puppet/forge/errors.rb', line 76 def initialize() @uri = [:uri] @input = [:input] = [:message] response = [:response] @response = "#{response.code} #{response.message.strip}" = "Could not execute operation for '#{@input}'. Detail: " << << " / " if << @response << "." super(, original) end |
Instance Method Details
#multiline ⇒ String
Return a multiline version of the error message
92 93 94 95 96 97 98 99 100 |
# File 'lib/puppet/forge/errors.rb', line 92 def multiline = "Could not execute operation for '\#{@input}'\n The server being queried was \#{@uri}\n The HTTP response we received was '\#{@response}'\n EOS\n message << \" The message we received said '\#{@message}'\\n\" if @message\n message << \" Check the author and module names are correct.\"\nend\n" |