Sha256: 676442706ae40a14c63bd1877c492c949f6e8808fd26f01d72bb3f85ecef1ce1

Contents?: true

Size: 762 Bytes

Versions: 63

Compression:

Stored size: 762 Bytes

Contents

# encoding: UTF-8
module MongoMapper
  # 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 document not valid and using !
  class DocumentNotValid < Error
    def initialize(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

63 entries across 63 versions & 8 rubygems

Version Path
thorsson-mongo_mapper-0.8.2 lib/mongo_mapper/exceptions.rb
mongo_mapper-unstable-2010.07.26 lib/mongo_mapper/exceptions.rb
mongo_mapper-unstable-2010.07.23 lib/mongo_mapper/exceptions.rb
mongo_mapper-unstable-2010.07.21 lib/mongo_mapper/exceptions.rb
mongo_mapper-unstable-2010.07.20 lib/mongo_mapper/exceptions.rb
mongo_mapper-unstable-2010.07.19 lib/mongo_mapper/exceptions.rb
mongo_mapper-unstable-2010.07.18 lib/mongo_mapper/exceptions.rb
mongo_mapper-unstable-2010.07.16 lib/mongo_mapper/exceptions.rb
mongo_mapper-unstable-2010.07.15 lib/mongo_mapper/exceptions.rb
mongo_mapper-unstable-2010.07.14 lib/mongo_mapper/exceptions.rb
mongo_mapper-unstable-2010.07.13 lib/mongo_mapper/exceptions.rb
mongo_mapper-unstable-2010.07.12 lib/mongo_mapper/exceptions.rb
mongo_mapper-unstable-2010.07.09 lib/mongo_mapper/exceptions.rb
mongo_mapper-unstable-2010.07.08 lib/mongo_mapper/exceptions.rb
mongo_mapper-unstable-2010.07.07 lib/mongo_mapper/exceptions.rb
mongo_mapper-unstable-2010.07.06 lib/mongo_mapper/exceptions.rb
mongo_mapper-unstable-2010.07.05 lib/mongo_mapper/exceptions.rb
mongo_mapper-unstable-2010.07.02 lib/mongo_mapper/exceptions.rb
mongo_mapper-unstable-2010.07.01 lib/mongo_mapper/exceptions.rb
mongo_mapper-unstable-2010.06.30 lib/mongo_mapper/exceptions.rb