class Puppet::Forge::Errors::CommunicationError

This exception is raised when there is a communication error when connecting to the forge

Public Class Methods

new(options) click to toggle source

@option options [String] :uri The URI that failed @option options [String] :original the original exception

Calls superclass method Puppet::Error.new
# File lib/puppet/forge/errors.rb, line 47
def initialize(options)
  @uri     = options[:uri]
  original = options[:original]
  @detail  = original.message

  message = "Unable to connect to the server at #{@uri}. Detail: #{@detail}."
  super(message, original)
end

Public Instance Methods

multiline() click to toggle source

Return a multiline version of the error message

@return [String] the multiline version of the error message

# File lib/puppet/forge/errors.rb, line 59
    def multiline
      message = "Could not connect to #{@uri}
  There was a network communications problem
    The error we caught said '#{@detail}'
    Check your network connection and try again
".chomp
    end