Class: Gem::SourceFetchProblem

Inherits:
ErrorReason show all
Defined in:
lib/rubygems/errors.rb

Overview

An error that indicates we weren’t able to fetch some data from a source

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source, error) ⇒ SourceFetchProblem

Creates a new SourceFetchProblem for the given source and error.



80
81
82
83
# File 'lib/rubygems/errors.rb', line 80

def initialize(source, error)
  @source = source
  @error = error
end

Instance Attribute Details

#errorObject (readonly) Also known as: exception

The fetch error which is an Exception subclass.



93
94
95
# File 'lib/rubygems/errors.rb', line 93

def error
  @error
end

#sourceObject (readonly)

The source that had the fetch problem.



88
89
90
# File 'lib/rubygems/errors.rb', line 88

def source
  @source
end

Instance Method Details

#wordyObject

An English description of the error.



98
99
100
# File 'lib/rubygems/errors.rb', line 98

def wordy
  "Unable to download data from #{@source.uri} - #{@error.message}"
end