Aqueti / mongoAPI

Mongo interface software that connects c++ interface to mongodb. This basic wrapper works with JsonBox and could be extended to work with other JSON libraries.
1 stars 0 forks source link

notify caller of errors #4

Open dhperkins opened 6 years ago

dhperkins commented 6 years ago

it seems like most of our methods here catch mongo exceptions and print them to std::out they're as good as ignored

dhperkins commented 6 years ago

an easy way to get this info out to callers who care might be to add an optional parameter to every method that takes a pointer to some kind of return code that defaults to null if the pointer is valid, an informative error is passed out this wouldn't require any changes in current code that uses mongoapi

JsonBox::Value MongoInterface::query(std::string collection, JsonBox::Value data) would become JsonBox::Value MongoInterface::query(std::string collection, JsonBox::Value data, aqt_Status *status = NULL)