Permalink
Browse files

Rescue more appropriate not found error

  • Loading branch information...
ches committed Jan 5, 2011
1 parent dab436d commit ed6d49be77ea4020e337e539af5192796856a556
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/rack/gridfs.rb
View
@@ -39,7 +39,7 @@ def call(env)
def gridfs_request(id)
file = Mongo::Grid.new(db).get(BSON::ObjectId.from_string(id))
[200, {'Content-Type' => file.content_type}, [file.read]]
- rescue Mongo::GridError, BSON::InvalidObjectId
+ rescue Mongo::GridFileNotFound, BSON::InvalidObjectId
[404, {'Content-Type' => 'text/plain'}, ['File not found.']]
end

0 comments on commit ed6d49b

Please sign in to comment.