Exception: Sohm::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Sohm::Error
- Defined in:
- lib/sohm.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 `Sohm::UniqueIndexViolation` during save, but
also, do some validations even before attempting to save.