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.



149
150
151
152
# File 'lib/rubygems/errors.rb', line 149

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.



162
163
164
# File 'lib/rubygems/errors.rb', line 162

def error
  @error
end

#sourceObject (readonly)

The source that had the fetch problem.



157
158
159
# File 'lib/rubygems/errors.rb', line 157

def source
  @source
end

Instance Method Details

#wordyObject

An English description of the error.



167
168
169
# File 'lib/rubygems/errors.rb', line 167

def wordy
  "Unable to download data from #{Gem::Uri.redact(@source.uri)} - #{@error.message}"
end