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
49 def initialize(options)
50   @uri     = options[:uri]
51   original = options[:original]
52   @detail  = original.message
53 
54   message = _("Unable to connect to the server at %{uri}. Detail: %{detail}.") % { uri: @uri, detail: @detail }
55   super(message, original)
56 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
61 def multiline
62   message = []
63   message << _('Could not connect to %{uri}') % { uri: @uri }
64   message << _('  There was a network communications problem')
65   message << _("    The error we caught said '%{detail}'") % { detail: @detail }
66   message << _('    Check your network connection and try again')
67   message.join("\n")
68 end