Sha256: 9e42a6e718445c3ce4d8c8923b725948f791fce751be9bfb1173e938fe5c8a0f

Contents?: true

Size: 1006 Bytes

Versions: 3

Compression:

Stored size: 1006 Bytes

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
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
flipper-0.14.0 lib/flipper/errors.rb
flipper-0.13.0 lib/flipper/errors.rb
flipper-0.13.0.beta1 lib/flipper/errors.rb