brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahgittin <...@git.apache.org>
Subject [GitHub] brooklyn-server pull request #571: Better error reporting
Date Fri, 03 Mar 2017 09:06:12 GMT
Github user ahgittin commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/571#discussion_r104112617
  
    --- Diff: rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ApplicationResource.java
---
    @@ -374,7 +378,13 @@ public Response createPoly(byte[] inputToAutodetectType) {
     
     
             if (spec != null) {
    -            return launch(potentialYaml, spec);
    +            try {
    +                return launch(potentialYaml, spec);
    +            } catch (Exception e) {
    +                Exceptions.propagateIfFatal(e);
    +                log.warn("Failed REST deployment launching "+spec+": "+e);
    +                throw WebResourceUtils.badRequest(e, "Error launching blueprint (autodetecting)");
    --- End diff --
    
    This seemed like the best status code to use and it's what we use on line 294/297.  Do
you think there's a better one?  If we do nothing it will give Internal Server Error which
seems worse?


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