Exception: Ohm::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/ohm.rb

Overview

All of the known errors in Ohm can be traced back to one of these exceptions.

MissingID:

Comment.new.id # => Error
Comment.new.key # => Error

Solution: you need to save your model first.

IndexNotFound:

Comment.find(:foo => "Bar") # => Error

Solution: add an index with `Comment.index :foo`.

UniqueIndexViolation:

Raised when trying to save an object with a `unique` index for
which the value already exists.

Solution: rescue `Ohm::UniqueIndexViolation` during save, but
also, do some validations even before attempting to save.

Direct Known Subclasses

IndexNotFound, MissingID, UniqueIndexViolation