brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahgittin <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Misc fixes working with plans
Date Tue, 15 Sep 2015 16:46:17 GMT
Github user ahgittin commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/887#discussion_r39534228
  
    --- Diff: core/src/main/java/org/apache/brooklyn/core/plan/PlanToSpecFactory.java ---
    @@ -95,13 +96,18 @@ public static PlanToSpecTransformer forPlanType(ManagementContext
mgmt, String p
             Collection<Exception> otherProblemsFromTransformers = new ArrayList<Exception>();
             for (PlanToSpecTransformer t: transformers) {
                 try {
    -                return Maybe.of(f.apply(t));
    +                T result = f.apply(t);
    +                if (result==null) {
    +                    transformersWhoDontSupport.add(t.getShortDescription() + " (returned
null)");
    +                    continue;
    +                }
    +                return Maybe.of(result);
                 } catch (PlanNotRecognizedException e) {
                     transformersWhoDontSupport.add(t.getShortDescription() +
                         (Strings.isNonBlank(e.getMessage()) ? " ("+e.getMessage()+")" : ""));
    -            } catch (Exception e) {
    +            } catch (Throwable e) {
    --- End diff --
    
    i think i was hoping to catch some weird errors, didn't realize propagateIfFatal would
grab all `Error`.  maybe for some things like class linking etc we don't treat them as fatal?


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