Sha256: fdf5493e8cae710babab6f316dc1341a930a37a09167aceca445ee68c9cdfae3

Contents?: true

Size: 1.07 KB

Versions: 9

Compression:

Stored size: 1.07 KB

Contents

module Minimart
  # The collection of Minimart specific errors.
  module Error
    class BaseError < StandardError; end

    # Raised when a dependency cannot be met.
    class UnresolvedDependency < BaseError; end

    # Raised when there is an error parsing the inventory file.
    class InvalidInventoryError < BaseError; end

    # Raised when a source does not respond to '/universe' correctly.
    class UniverseNotFoundError < BaseError; end

    # Raised when none of the available sources have a given cookbook.
    class CookbookNotFound < BaseError; end

    # Raised when there is a conflict between different versions of the same cookbook.
    class BrokenDependency < BaseError; end

    # Raised when Minimart encounters a cookbook with a location type that it can't handle
    class UnknownLocationType < BaseError; end

    # Gracefully handle any errors raised by Minimart, and exit with a failure
    # status code.
    # @param [Minimart::Error::BaseError] ex
    def self.handle_exception(ex)
      Configuration.output.puts_red(ex.message)
      exit false
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
minimart-1.2.5 lib/minimart/error.rb
minimart-1.2.4 lib/minimart/error.rb
minimart-1.2.3 lib/minimart/error.rb
minimart-1.2.0 lib/minimart/error.rb
minimart-1.1.6 lib/minimart/error.rb
minimart-1.1.3 lib/minimart/error.rb
minimart-1.0.2 lib/minimart/error.rb
minimart-1.0.1 lib/minimart/error.rb
minimart-0.0.1 lib/minimart/error.rb