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 [email protected] or file a JIRA ticket
with INFRA.
---