W3cubDocs

/Ruby 2.7

class Bundler::BundlerError

Parent:
StandardError

Public Class Methods

all_errors() Show source
# File lib/bundler/errors.rb, line 15
def self.all_errors
  @all_errors ||= {}
end
status_code(code) Show source
# File lib/bundler/errors.rb, line 5
def self.status_code(code)
  define_method(:status_code) { code }
  if match = BundlerError.all_errors.find {|_k, v| v == code }
    error, _ = match
    raise ArgumentError,
      "Trying to register #{self} for status code #{code} but #{error} is already registered"
  end
  BundlerError.all_errors[self] = code
end

Ruby Core © 1993–2017 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.