Skip to content

Conversation

@m4tty
Copy link
Contributor

@m4tty m4tty commented Jan 5, 2013

wrap was being passed an Error object containing the MongoError, but wrap expects a MongoError document alone which it will wrap in an Error object. In this case, findOne was putting the MongoError document into an Error object and then also handing that Error object to wrap, which would then new up another Error object and use the input Error as the message.

I couldn't find any other instances of this issue other than this one (in findOne).

Possibly could check for instanceOf Error within wrap to double check and then unwrap (i.e. pull the message) and rewrap.

@christkv christkv merged commit d158cf3 into mongodb:master Jan 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants