mongoid/mongoid — Issue #1635: More Comprehensive Exceptions
Author: durran
Created: 2012-01-23 16:04:13+00:00
State: open
Labels: enhancement

Our exceptions are good, better than most, but need to bring joy to the developer's soul when they are thrown.

All exceptions should provide:
- A title.
- A summary of what caused the problem.
- Steps to take to resolve the error.

A sample message when raised:

```txt
Mongoid::Errors::DocumentNotFound:

Message: Document was not found for id(s) 1.
Summary:
When calling Model.find() with an id or array of ids, each parameter must match
a document in the database or this error will be raised.
Resolution:
a) Search for an id that is in the database.
b) Set the Mongoid.raise_not_found_error configuration option to false, which will
cause a nil to be returned instead of raising this error.
```