Sha256: c96a66f3fb9d91f59f3194a94e0943366beee3e7dc30ec0cf5024558726f2851

Contents?: true

Size: 492 Bytes

Versions: 4

Compression:

Stored size: 492 Bytes

Contents

module Jschematic
  class ValidationError < StandardError
    attr_reader :what, :expected, :actual

    def initialize(what, expected, actual)
      @what, @expected, @actual = what, expected, actual
    end

    def to_s
      "#{what} expected #{expected} but found #{actual}"
    end
  end

  class SchemaNotFoundError < StandardError
    attr_reader :uri

    def initialize(uri)
      @uri = uri
    end

    def to_s
      "Cannot find schema for reference '#{uri}'"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
jschematic-0.1.0 lib/jschematic/exceptions.rb
jschematic-0.0.9 lib/jschematic/exceptions.rb
jschematic-0.0.6 lib/jschematic/exceptions.rb
jschematic-0.0.5 lib/jschematic/exceptions.rb