diff options
Diffstat (limited to 'lib/rubygems/errors.rb')
-rw-r--r-- | lib/rubygems/errors.rb | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/rubygems/errors.rb b/lib/rubygems/errors.rb index f115ce23d0..be6c34dc85 100644 --- a/lib/rubygems/errors.rb +++ b/lib/rubygems/errors.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + #-- # This file contains all the various exceptions and other errors that are used # inside of RubyGems. @@ -60,7 +61,7 @@ module Gem def build_message names = specs.map(&:full_name) - "Could not find '#{name}' (#{requirement}) - did find: [#{names.join ','}]\n" + "Could not find '#{name}' (#{requirement}) - did find: [#{names.join ","}]\n" end end @@ -133,11 +134,7 @@ module Gem ## # A wordy description of the error. def wordy - "Found %s (%s), but was for platform%s %s" % - [@name, - @version, - @platforms.size == 1 ? '' : 's', - @platforms.join(' ,')] + format("Found %s (%s), but was for platform%s %s", @name, @version, @platforms.size == 1 ? "" : "s", @platforms.join(" ,")) end end @@ -168,12 +165,12 @@ module Gem # An English description of the error. def wordy - "Unable to download data from #{Gem::Uri.new(@source.uri).redacted} - #{@error.message}" + "Unable to download data from #{Gem::Uri.redact(@source.uri)} - #{@error.message}" end ## # The "exception" alias allows you to call raise on a SourceFetchProblem. - alias exception error + alias_method :exception, :error end end |