mongoid/mongoid — pull request #1382 by mathieuravaux (2011-10-28 14:06:06+00:00)
Title: create_indexes rake task silently swallows exceptions, hiding invalid index specification reporting

When you incorrectly specify an index in a model, Mongoid raises an exception with a nice explanation message:

Mongo::MongoArgumentError:Invalid index specification [:game_id, -1]; should be either a string, symbol, or an array of arrays.

Except it doesn't.

These exceptions are rescued without any mention in the command output. The net result is missing indexes on specific collection, which then can take quite a bit of time and production slownesses before getting figured out.

This occurs since the last modification of `lib/rails/mongoid.rb` (in eca6f32: Fixing all the failures for 1.8.7).

The attached pull request logs index creation failures to STDOUT instead of swallowing them silently.