Exception: Bundler::BundlerError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/bundler/errors.rb

Class Method Summary collapse

Class Method Details

.all_errorsObject



14
15
16
# File 'lib/bundler/errors.rb', line 14

def self.all_errors
  @all_errors ||= {}
end

.status_code(code) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/bundler/errors.rb', line 4

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