ahoward/mongoid-grid_fs — pull request #9 by rmm5t (2013-02-09 18:52:53+00:00)
Title: Cleanup chunks only when rescuing from an error

Relying on the `$!` variable to made it possible to unintentionally destroy chunks during a successful pass if the `$!` variable was set by something else upstream.

E.g. `$!` is set to an EOFError under the Pow server, because the Nack server runs everything through an (expected) `EOFError` rescue block:

https://github.com/josh/nack/blob/master/lib/nack/server.rb#L98-L101

Fixes #7