You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by ahgittin <gi...@git.apache.org> on 2017/03/03 09:06:12 UTC

[GitHub] brooklyn-server pull request #571: Better error reporting

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