New answers tagged


There is a problem regarding error handling: in callDB() you catch all exceptions and log them in the console without passing them on to the caller. Either you should rethrow the exception (or a modified version that is more helpful for the caller) or not catch it at all. Since the MongoClient.connect() can also fail, I would move it into the try/catch as ...

Top 50 recent answers are included