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