Modify how to deal with mongodb

Make the message more general, because maybe there is a problem with the write but the connection was performed successfully. *Error writing to MongoDB*.