Github user DLotts commented on a diff in the pull request:

    https://github.com/apache/incubator-rya/pull/67#discussion_r75216775
  
    --- Diff: dao/mongodb.rya/src/main/java/mvm/rya/mongodb/MongoDBRyaDAO.java 
---
    @@ -73,14 +73,9 @@
          */
         public MongoDBRyaDAO(final MongoDBRdfConfiguration conf) throws 
RyaDAOException, NumberFormatException, UnknownHostException {
             this.conf = conf;
    -        try {
    -            mongoClient = MongoConnectorFactory.getMongoClient(conf);
    -            conf.setMongoClient(mongoClient);
    -            init();
    -        } catch (NumberFormatException | UnknownHostException e) {
    -            log.error("Unable to create a connection to mongo.", e);
    -            throw e;
    -        }
    +        mongoClient = MongoConnectorFactory.getMongoClient(conf);
    --- End diff --
    
    the UnknownHostException is a checked exception and must be caught.  I 
removed both of the exceptions and wrapped into better unchecked exceptions.  I 
assume that the default error handler will log the error.  Otherwise we should 
attempt to log every unchecked exception.  I made the underlying thrown errors 
more descriptive, they all mention that the MongoDB connection has failed, so 
this log entry is redundant.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to