Moved logic for translating errors into its own function.
Moved logic for translating errors into its own function.

Translating an Mongoose error into a restify erro might be needed in
more places than just onError. We can't use onError for this because it
expects a restify next callback.

pierredavidbelanger/restify-mongoose,ceosilvajr/restify-mongoose,pierredavidbelanger/restify-mongoose,mancvso/restify-mongoose,ceosilvajr/restify-mongoose,saintedlama/restify-mongoose,mancvso/restify-mongoose