Exception: Gem::RemoteFetcher::FetchError

Inherits:
Exception
  • Object
show all
Includes:
UriParsing
Defined in:
lib/rubygems/remote_fetcher.rb

Overview

A FetchError exception wraps up the various possible IO and HTTP failures that could happen while downloading from the internet.

Direct Known Subclasses

UnknownHostError

Instance Attribute Summary collapse

Attributes inherited from Exception

#source_exception

Instance Method Summary collapse

Methods included from Deprecate

deprecate, skip, skip=, skip_during

Constructor Details

#initialize(message, uri) ⇒ FetchError

Returns a new instance of FetchError.



36
37
38
39
40
41
42
43
44
# File 'lib/rubygems/remote_fetcher.rb', line 36

def initialize(message, uri)
  super message

  uri = parse_uri(uri)

  uri.password = 'REDACTED' if uri.respond_to?(:password) && uri.password

  @uri = uri.to_s
end

Instance Attribute Details

#uriObject

The URI which was being accessed when the exception happened.



34
35
36
# File 'lib/rubygems/remote_fetcher.rb', line 34

def uri
  @uri
end

Instance Method Details

#to_sObject

:nodoc:



46
47
48
# File 'lib/rubygems/remote_fetcher.rb', line 46

def to_s # :nodoc:
  "#{super} (#{uri})"
end