Return-Path: X-Original-To: apmail-usergrid-commits-archive@minotaur.apache.org Delivered-To: apmail-usergrid-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F10DF109FB for ; Tue, 4 Mar 2014 00:22:58 +0000 (UTC) Received: (qmail 31551 invoked by uid 500); 4 Mar 2014 00:22:57 -0000 Delivered-To: apmail-usergrid-commits-archive@usergrid.apache.org Received: (qmail 31520 invoked by uid 500); 4 Mar 2014 00:22:57 -0000 Mailing-List: contact commits-help@usergrid.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@usergrid.incubator.apache.org Delivered-To: mailing list commits@usergrid.incubator.apache.org Received: (qmail 31484 invoked by uid 99); 4 Mar 2014 00:22:56 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Mar 2014 00:22:56 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 2F484934927; Tue, 4 Mar 2014 00:22:56 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: snoopdave@apache.org To: commits@usergrid.apache.org Date: Tue, 04 Mar 2014 00:22:58 -0000 Message-Id: <588a167bd4ba4d56aa5a4f575648d699@git.apache.org> In-Reply-To: <07e5f035897744fdbc54ec29be62f170@git.apache.org> References: <07e5f035897744fdbc54ec29be62f170@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/5] git commit: Changed error message returned, now throws the exception. Changed error message returned, now throws the exception. Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/95f8773b Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/95f8773b Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/95f8773b Branch: refs/pull/60/head Commit: 95f8773b72b279056467dbae8932ab0c2ba913a9 Parents: 0d4f3df Author: grey Authored: Mon Mar 3 15:23:27 2014 -0800 Committer: grey Committed: Mon Mar 3 15:23:27 2014 -0800 ---------------------------------------------------------------------- .../applications/ApplicationResource.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/95f8773b/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/ApplicationResource.java ---------------------------------------------------------------------- diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/ApplicationResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/ApplicationResource.java index 62ecf34..7f7c6e4 100644 --- a/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/ApplicationResource.java +++ b/stack/rest/src/main/java/org/apache/usergrid/rest/management/organizations/applications/ApplicationResource.java @@ -234,7 +234,7 @@ public class ApplicationResource extends AbstractContextResource { } catch ( NullPointerException e ) { OAuthResponse errorMsg = - OAuthResponse.errorResponse( SC_BAD_REQUEST ).setErrorDescription( "Job Not Created" ) + OAuthResponse.errorResponse( SC_BAD_REQUEST ).setErrorDescription( e.getMessage() ) .buildJSONMessage(); return Response.status( errorMsg.getResponseStatus() ).type( JSONPUtils.jsonMediaType( callback ) ) @@ -275,7 +275,7 @@ public class ApplicationResource extends AbstractContextResource { } catch ( NullPointerException e ) { OAuthResponse errorMsg = - OAuthResponse.errorResponse( SC_BAD_REQUEST ).setErrorDescription( "Job Not Created" ) + OAuthResponse.errorResponse( SC_BAD_REQUEST ).setErrorDescription( e.getMessage()) .buildJSONMessage(); return Response.status( errorMsg.getResponseStatus() ).type( JSONPUtils.jsonMediaType( callback ) ) @@ -307,7 +307,14 @@ public class ApplicationResource extends AbstractContextResource { } catch ( Exception e ) { //this might be due to other reasons, but gotta look up what service manager does. - return Response.status( SC_BAD_REQUEST ).build(); + + OAuthResponse errorMsg = + OAuthResponse.errorResponse( SC_BAD_REQUEST ).setErrorDescription( e.getMessage()) + .buildJSONMessage(); + + return Response.status( errorMsg.getResponseStatus() ).type( JSONPUtils.jsonMediaType( callback ) ) + .entity( ServiceResource.wrapWithCallback( errorMsg.getBody(), callback ) ).build(); + // return Response.status( SC_BAD_REQUEST ).build(); } //validate this user owns it