brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] brooklyn-server pull request #613: Returns catalog items created via REST AP...
Date Tue, 28 Mar 2017 09:54:49 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/613#discussion_r108380227
  
    --- Diff: rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/CatalogResource.java
---
    @@ -146,33 +146,15 @@ public Response createFromYaml(String yaml) {
                 throw WebResourceUtils.forbidden("User '%s' is not authorized to add catalog
item",
                     Entitlements.getEntitlementContext().user());
             }
    -        
    -        Iterable<? extends CatalogItem<?, ?>> items; 
    +
             try {
    -            items = brooklyn().getCatalog().addItems(yaml);
    +            final Iterable<? extends CatalogItem<?, ?>> items = brooklyn().getCatalog().addItems(yaml);
    +            return buildCreateResponse(items);
             } catch (Exception e) {
                 e.printStackTrace();
    --- End diff --
    
    We should never use `e.printStackTrace()` (not introduced in this PR; I just spotted it
while looking over these changes)


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message