You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ve...@apache.org on 2015/05/13 23:27:49 UTC
[08/50] [abbrv] incubator-atlas git commit: Add response body to
MetadataServiceException
Add response body to MetadataServiceException
reformat and remove unused constructor
MetadataServiceException should report response body and response status
Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/8ee845be
Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/8ee845be
Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/8ee845be
Branch: refs/remotes/origin/master
Commit: 8ee845beba04e41c19af60ee0b03d79f1b74acd3
Parents: 5fda7b7
Author: Aaron Dossett <aa...@target.com>
Authored: Fri May 1 16:02:02 2015 -0500
Committer: Aaron Dossett <aa...@target.com>
Committed: Fri May 1 16:17:28 2015 -0500
----------------------------------------------------------------------
.../org/apache/hadoop/metadata/MetadataServiceClient.java | 3 ++-
.../apache/hadoop/metadata/MetadataServiceException.java | 10 ++++++----
2 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/8ee845be/client/src/main/java/org/apache/hadoop/metadata/MetadataServiceClient.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/hadoop/metadata/MetadataServiceClient.java b/client/src/main/java/org/apache/hadoop/metadata/MetadataServiceClient.java
index 0f8f129..5487281 100755
--- a/client/src/main/java/org/apache/hadoop/metadata/MetadataServiceClient.java
+++ b/client/src/main/java/org/apache/hadoop/metadata/MetadataServiceClient.java
@@ -250,7 +250,8 @@ public class MetadataServiceClient {
throw new MetadataServiceException(api, e);
}
}
- throw new MetadataServiceException(api, clientResponse.getClientResponseStatus());
+
+ throw new MetadataServiceException(api, clientResponse);
}
private JSONObject callAPI(API api, Object requestObject,
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/8ee845be/client/src/main/java/org/apache/hadoop/metadata/MetadataServiceException.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/hadoop/metadata/MetadataServiceException.java b/client/src/main/java/org/apache/hadoop/metadata/MetadataServiceException.java
index 882e5bf..e22e079 100755
--- a/client/src/main/java/org/apache/hadoop/metadata/MetadataServiceException.java
+++ b/client/src/main/java/org/apache/hadoop/metadata/MetadataServiceException.java
@@ -27,10 +27,12 @@ public class MetadataServiceException extends Exception {
super("Metadata service API " + api + " failed", e);
}
- public MetadataServiceException(MetadataServiceClient.API api, ClientResponse.Status status) {
- super("Metadata service API " + api + " failed with status " + status.getStatusCode()
- + "(" + status.getReasonPhrase() + ")");
- this.status = status;
+ public MetadataServiceException(MetadataServiceClient.API api, ClientResponse response) {
+ super("Metadata service API " + api + " failed with status " +
+ response.getClientResponseStatus().getStatusCode() + "(" +
+ response.getClientResponseStatus().getReasonPhrase() + ") Response Body (" +
+ response.getEntity(String.class) + ")");
+ this.status = response.getClientResponseStatus();
}
public MetadataServiceException(Exception e) {