Permalink
Browse files

More consistent error handling

  • Loading branch information...
1 parent 7845506 commit 0d97b79d18e7ef9131f36487513acd6cd874523a Michael Hughes committed Feb 16, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/server/mongostore.coffee
@@ -13,7 +13,7 @@ exports.createMongostore = (connectionString)->
clear:(fun)->
@connect (err,collection)->
- throw err if err
+ fun err,null if err
collection.remove {},fun
count:(fun)->
@@ -23,7 +23,7 @@ exports.createMongostore = (connectionString)->
insert:(data,fun)->
@connect (err,collection)->
- throw err if err
+ fun err,null if err
collection.insert data,{w:1},fun
getSets:(fun)->
@@ -33,5 +33,5 @@ exports.createMongostore = (connectionString)->
getFacet:(facetName,fun)->
@connect (err,collection)->
- throw err if err
+ fun err,null if err
collection.aggregate [{$group:{_id:"$"+facetName,count:{$sum:1}}},{$sort:{count:-1}}],[],fun

0 comments on commit 0d97b79

Please sign in to comment.