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 153

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 166

attr_reader :error

#exception (readonly)

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

[ GitHub ]

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

alias exception error

#source (readonly)

The source that had the fetch problem.

[ GitHub ]

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

attr_reader :source

Instance Method Details

#wordy

An English description of the error.

[ GitHub ]

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

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