You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by GitBox <gi...@apache.org> on 2022/02/14 10:56:39 UTC

[GitHub] [brooklyn-server] algairim commented on a change in pull request #1300: Gracefully handle invalid sensor types in REST requests

algairim commented on a change in pull request #1300:
URL: https://github.com/apache/brooklyn-server/pull/1300#discussion_r805725049



##########
File path: rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ApplicationResource.java
##########
@@ -710,13 +711,7 @@ private void checkLocationsAreValid(ApplicationSpec applicationSpec) {
             return result;
         }
         for (Entity e: descs) {
-            Object v = null;
-            try {
-                v = e.getAttribute((AttributeSensor<?>)s);
-            } catch (Exception exc) {
-                Exceptions.propagateIfFatal(exc);
-                log.warn("Error retrieving sensor "+s+" for "+e+" (ignoring): "+exc);
-            }

Review comment:
       This code has been moved into `EntityAttributesUtils` and re-used in all explicit attempts to retrieve a sensor in `rest-resources` project, see next line.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org