Sha256: 5f7fffca88826245554100d440bac8ac242a4dc537554f7421c7f0fd8269e5d1

Contents?: true

Size: 908 Bytes

Versions: 6

Compression:

Stored size: 908 Bytes

Contents

# encoding: UTF-8
module MarkMapper
  # generic MM error
  class Error < StandardError; end

  # raised when document expected but not found
  class DocumentNotFound < Error; end

  # raised when trying to connect using uri with incorrect scheme
  class InvalidScheme < Error; end

  # raised when trying to do something not supported, mostly for edocs
  class NotSupported < Error; end

  # raised when trying to create a key with an invalid name
  class InvalidKey < Error; end

  # raised when document not valid and using !
  class DocumentNotValid < Error
    attr_reader :document

    def initialize(document)
      @document = document
      super("Validation failed: #{document.errors.full_messages.join(", ")}")
    end
  end

  class AccessibleOrProtected < Error
    def initialize(name)
      super("Declare either attr_protected or attr_accessible for #{name}, but not both.")
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mark_mapper-0.0.6 lib/mark_mapper/exceptions.rb
mark_mapper-0.0.5 lib/mark_mapper/exceptions.rb
mark_mapper-0.0.4 lib/mark_mapper/exceptions.rb
mark_mapper-0.0.3 lib/mark_mapper/exceptions.rb
mark_mapper-0.0.2 lib/mark_mapper/exceptions.rb
mark_mapper-0.0.1 lib/mark_mapper/exceptions.rb