Sha256: 0f0acb50a6907677bee8c12c3e53dd04381d7e0b8d0897f11fa477d00d62adc3

Contents?: true

Size: 1.25 KB

Versions: 17

Compression:

Stored size: 1.25 KB

Contents

module Flipper
  # Top level error that all other errors inherit from.
  class Error < StandardError; end

  # Raised when gate can not be found for a thing.
  class GateNotFound < Error
    def initialize(thing)
      super "Could not find gate for #{thing.inspect}"
    end
  end

  # Raised when attempting to declare a group name that has already been used.
  class DuplicateGroup < Error; end

  # Raised when default instance not configured but there is an attempt to
  # use it.
  class DefaultNotSet < Flipper::Error
    def initialize(message = nil)
      default = "Default flipper instance not configured. See " \
                "Flipper.configure for how to configure the default instance."
      super(message || default)
    end
  end

  # Raised when an invalid value is set to a configuration property
  class InvalidConfigurationValue < Flipper::Error
    def initialize(message = nil)
      default = "Configuration value is not valid."
      super(message || default)
    end
  end

  # Raised when accessing a configuration property that has been deprecated
  class ConfigurationDeprecated < Flipper::Error
    def initialize(message = nil)
      default = "The configuration property has been deprecated"
      super(message || default)
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
flipper-0.20.4 lib/flipper/errors.rb
flipper-0.20.3 lib/flipper/errors.rb
flipper-0.20.2 lib/flipper/errors.rb
flipper-0.20.1 lib/flipper/errors.rb
flipper-0.20.0 lib/flipper/errors.rb
flipper-0.20.0.beta3 lib/flipper/errors.rb
flipper-0.20.0.beta2 lib/flipper/errors.rb
flipper-0.20.0.beta1 lib/flipper/errors.rb
flipper-0.19.1 lib/flipper/errors.rb
flipper-0.19.0 lib/flipper/errors.rb
flipper-0.18.0 lib/flipper/errors.rb
flipper-0.17.2 lib/flipper/errors.rb
flipper-0.17.1 lib/flipper/errors.rb
flipper-0.16.2 lib/flipper/errors.rb
flipper-0.16.1 lib/flipper/errors.rb
flipper-0.16.0 lib/flipper/errors.rb
flipper-0.15.0 lib/flipper/errors.rb