Exception: Gem::RemoteFetcher::FetchError

Inherits:
Exception
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(message, uri) ⇒ FetchError

Returns a new instance of FetchError.



28
29
30
31
32
33
34
35
# File 'lib/rubygems/remote_fetcher.rb', line 28

def initialize(message, uri)
  uri = Gem::Uri.new(uri)

  super uri.redact_credentials_from(message)

  @original_uri = uri.to_s
  @uri = uri.redacted.to_s
end

Instance Attribute Details

#original_uriObject

The URI which was being accessed when the exception happened.



26
27
28
# File 'lib/rubygems/remote_fetcher.rb', line 26

def original_uri
  @original_uri
end

#uriObject

The URI which was being accessed when the exception happened.



26
27
28
# File 'lib/rubygems/remote_fetcher.rb', line 26

def uri
  @uri
end

Instance Method Details

#to_sObject

:nodoc:



37
38
39
# File 'lib/rubygems/remote_fetcher.rb', line 37

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