Sha256: 321262a84468826632c2a01c7613c4f06cb39b31ba7b06a4f0592ca7e1c9f76f

Contents?: true

Size: 1.08 KB

Versions: 3

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true

module Hanami
  class View
    # Error raised when critical settings are not configured
    #
    # @api private
    class UndefinedConfigError < StandardError
      def initialize(key)
        super("no +#{key}+ configured")
      end
    end

    # Error raised when template could not be found within a view's configured
    # paths
    #
    # @api private
    class TemplateNotFoundError < StandardError
      def initialize(template_name, lookup_paths)
        msg = [
          "Template +#{template_name}+ could not be found in paths:",
          lookup_paths.map { |path| " - #{path}" }
        ].join("\n\n")

        super(msg)
      end
    end

    # Error raised when layout could not be found within a view's configured
    # paths
    #
    # @api private
    class LayoutNotFoundError < StandardError
      def initialize(layout_name, lookup_paths)
        msg = [
          "Layout +#{layout_name}+ could not be found in paths:",
          lookup_paths.map { |path| " - #{path}" }
        ].join("\n\n")

        super(msg)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hanami-view-2.0.0.alpha6 lib/hanami/view/errors.rb
hanami-view-2.0.0.alpha5 lib/hanami/view/errors.rb
hanami-view-2.0.0.alpha3 lib/hanami/view/errors.rb