Sha256: 9de6b20170bbc903b3105bf7fc2ea91f7183dc26fc9e33d2c6e906d6bd3750b1

Contents?: true

Size: 1.39 KB

Versions: 1

Compression:

Stored size: 1.39 KB

Contents

module Onsi
  ##
  # Container module for custom errors
  module Errors
    ##
    # Base Error for all Onsi custom errors
    #
    # @author Maddie Schipper
    # @since 1.0.0
    class BaseError < StandardError; end

    ##
    # An unknown version is requested to be rendered
    #
    # @author Maddie Schipper
    # @since 1.0.0
    class UnknownVersionError < BaseError
      ##
      # The class that does not support the requested version.
      attr_reader :klass

      ##
      # The version requested that isn't supported
      attr_reader :version

      ##
      # Create a new UnknownVersionError
      #
      # @param klass (see #klass)
      #
      # @param version (see #version)
      def initialize(klass, version)
        super("Unsupported version #{version} for #{klass.name}")
        @klass = klass
        @version = version
      end
    end

    ##
    # Included Param Error
    #
    # @author Maddie Schipper
    # @since 1.1.0
    class IncludedParamError < BaseError
      ##
      # The path that failed to parse.
      attr_reader :path

      ##
      # @private
      #
      # Create a new IncludedParamError
      def initialize(message, path)
        super(message)
        @path = path
      end
    end

    ##
    # Raised when there is an error with pagination
    #
    # @author Maddie Schipper
    # @since 1.4.0
    class PaginationError < BaseError
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
onsi-2.0.1 lib/onsi/errors.rb