123456789_123456789_123456789_123456789_123456789_

Class: Gem::SourceFetchProblem

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, ErrorReason
Instance Chain:
self, ErrorReason
Inherits: Gem::ErrorReason
Defined in: lib/rubygems/errors.rb

Overview

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

Class Method Summary

Instance Attribute Summary

  • #error (also: #exception) readonly

    The fetch error which is an Exception subclass.

  • #exception readonly

    The “exception” alias allows you to call raise on a SourceFetchProblem.

  • #source readonly

    The source that had the fetch problem.

Instance Method Summary

  • #wordy

    An English description of the error.

Constructor Details

.new(source, error) ⇒ SourceFetchProblem

Creates a new SourceFetchProblem for the given #source and #error.

[ GitHub ]

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

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

Instance Attribute Details

#error (readonly) Also known as: #exception

The fetch error which is an Exception subclass.

[ GitHub ]

  
# File 'lib/rubygems/errors.rb', line 170

attr_reader :error

#exception (readonly)

The “exception” alias allows you to call raise on a SourceFetchProblem.

[ GitHub ]

  
# File 'lib/rubygems/errors.rb', line 183

alias exception error

#source (readonly)

The source that had the fetch problem.

[ GitHub ]

  
# File 'lib/rubygems/errors.rb', line 165

attr_reader :source

Instance Method Details

#wordy

An English description of the error.

[ GitHub ]

  
# File 'lib/rubygems/errors.rb', line 175

def wordy
  @source.uri.password = 'REDACTED' unless @source.uri.password.nil?
  "Unable to download data from #{@source.uri} - #{@error.message}"
end