Sha256: 9ede7e1fbc4dee6f124f65c67cfbb55931d814b7934db6ef4cae2bca6e15c736

Contents?: true

Size: 882 Bytes

Versions: 2

Compression:

Stored size: 882 Bytes

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
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
onsi-1.0.1 lib/onsi/errors.rb
onsi-1.0.0 lib/onsi/errors.rb