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

    https://github.com/apache/incubator-eagle/pull/324#discussion_r74361599
  
    --- Diff: 
eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/MongoMetadataDaoImpl.java
 ---
    @@ -285,6 +318,21 @@ public OpResult removePublishmentType(String pubType) {
             return remove(publishmentType, pubType);
         }
     
    +    private <T> OpResult addOne(MongoCollection<Document> collection, T t) 
{
    +        OpResult result = new OpResult();
    +        try {
    +            String json = mapper.writeValueAsString(t);
    +            collection.insertOne(Document.parse(json));
    +            result.code = 200;
    +            result.message = "add state succeed!";
    +        } catch (Exception e) {
    +            result.code = 400;
    +            result.message = e.getMessage();
    +            LOG.error("", e);
    --- End diff --
    
    better to have meaningful message


---
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