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/heads/master Commit: 95f8773b72b279056467dbae8932ab0c2ba913a9 Parents: 0d4f3df Author: grey <[email protected]> Authored: Mon Mar 3 15:23:27 2014 -0800 Committer: grey <[email protected]> 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
