Exception: Gem::RemoteFetcher::FetchError
- 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
Instance Attribute Summary collapse
-
#uri ⇒ Object
The URI which was being accessed when the exception happened.
Attributes inherited from Exception
Instance Method Summary collapse
-
#initialize(message, uri) ⇒ FetchError
constructor
A new instance of FetchError.
-
#to_s ⇒ Object
:nodoc:.
Methods included from Deprecate
deprecate, skip, skip=, skip_during
Constructor Details
#initialize(message, uri) ⇒ FetchError
Returns a new instance of FetchError.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/rubygems/remote_fetcher.rb', line 28 def initialize(, uri) super begin uri = URI(uri) uri.password = 'REDACTED' if uri.password @uri = uri.to_s rescue URI::InvalidURIError, ArgumentError @uri = uri end end |
Instance Attribute Details
#uri ⇒ Object
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_s ⇒ Object
:nodoc:
39 40 41 |
# File 'lib/rubygems/remote_fetcher.rb', line 39 def to_s # :nodoc: "#{super} (#{uri})" end |