You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sn...@apache.org on 2014/03/10 22:22:44 UTC

[15/50] [abbrv] git commit: removed vague stack trace from Server Error.

removed vague stack trace from Server Error.


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/11b235be
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/11b235be
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/11b235be

Branch: refs/pull/70/head
Commit: 11b235be46a369b2ee72f85062063ce2db482bd2
Parents: c7553a3
Author: grey <gr...@apigee.com>
Authored: Fri Feb 28 12:17:45 2014 -0800
Committer: grey <gr...@apigee.com>
Committed: Fri Feb 28 12:17:45 2014 -0800

----------------------------------------------------------------------
 .../organizations/applications/ApplicationResource.java       | 6 +++++-
 .../apache/usergrid/management/export/ExportServiceImpl.java  | 7 +------
 2 files changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/11b235be/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 4187e3e..158991a 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
@@ -284,7 +284,11 @@ public class ApplicationResource extends AbstractContextResource {
         catch ( Exception e ) {
             //TODO:throw descriptive error message and or include on in the response
             //TODO:fix below, it doesn't work if there is an exception. Make it look like the OauthResponse.
-            return Response.status( SC_INTERNAL_SERVER_ERROR ).build();
+            OAuthResponse errorMsg =
+                    OAuthResponse.errorResponse( SC_INTERNAL_SERVER_ERROR ).setErrorDescription( e.getMessage() )
+                                 .buildJSONMessage();
+            return Response.status( errorMsg.getResponseStatus() ).type( JSONPUtils.jsonMediaType( callback ) )
+                           .entity( ServiceResource.wrapWithCallback( errorMsg.getBody(), callback ) ).build();
         }
 
         return Response.status( SC_ACCEPTED ).entity( uuidRet ).build();

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/11b235be/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java b/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java
index f0fa965..f5cc642 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java
@@ -141,6 +141,7 @@ public class ExportServiceImpl implements ExportService {
         em.update( export );
 
         if ( config.getCollection() == null ) {
+            //exports all the applications for a given organization.
             Map<UUID, String> organizations = getOrgs();
             for ( Map.Entry<UUID, String> organization : organizations.entrySet() ) {
                 try {
@@ -229,12 +230,6 @@ public class ExportServiceImpl implements ExportService {
         this.managementService = managementService;
     }
 
-
-    //write test checking to see what happens if the input stream is closed or wrong.
-    //TODO: make multipart streaming functional
-    //currently only stores the collection in memory then flushes it.
-
-
     /**
      * Exports all applications for the given organization.
      * @param organization