From 34e6806becf14f1b9bf0aeac1f7cc11d2aad95b1 Mon Sep 17 00:00:00 2001 From: Marco Ziccardi Date: Wed, 20 Jan 2016 07:55:39 +0100 Subject: [PATCH] Add throwable cause to DatastoreException --- .../src/main/java/com/google/gcloud/BaseServiceException.java | 2 +- .../java/com/google/gcloud/datastore/DatastoreException.java | 2 +- .../main/java/com/google/gcloud/spi/DefaultDatastoreRpc.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gcloud-java-core/src/main/java/com/google/gcloud/BaseServiceException.java b/gcloud-java-core/src/main/java/com/google/gcloud/BaseServiceException.java index 351ad6cd188a..b91090f94e82 100644 --- a/gcloud-java-core/src/main/java/com/google/gcloud/BaseServiceException.java +++ b/gcloud-java-core/src/main/java/com/google/gcloud/BaseServiceException.java @@ -105,7 +105,7 @@ public BaseServiceException(int code, String message, String reason, boolean ide } public BaseServiceException(int code, String message, String reason, boolean idempotent, - Exception cause) { + Throwable cause) { super(message, cause); this.code = code; this.reason = reason; diff --git a/gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/DatastoreException.java b/gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/DatastoreException.java index a7e6785b8a8c..ecad69ac635b 100644 --- a/gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/DatastoreException.java +++ b/gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/DatastoreException.java @@ -39,7 +39,7 @@ public class DatastoreException extends BaseServiceException { new Error(503, "UNAVAILABLE")); private static final long serialVersionUID = 2663750991205874435L; - public DatastoreException(int code, String message, String reason, Exception cause) { + public DatastoreException(int code, String message, String reason, Throwable cause) { super(code, message, reason, true, cause); } diff --git a/gcloud-java-datastore/src/main/java/com/google/gcloud/spi/DefaultDatastoreRpc.java b/gcloud-java-datastore/src/main/java/com/google/gcloud/spi/DefaultDatastoreRpc.java index ac00d94692de..c82ff9689f68 100644 --- a/gcloud-java-datastore/src/main/java/com/google/gcloud/spi/DefaultDatastoreRpc.java +++ b/gcloud-java-datastore/src/main/java/com/google/gcloud/spi/DefaultDatastoreRpc.java @@ -107,7 +107,7 @@ private static DatastoreException translate( return new DatastoreException((IOException) exception.getCause()); } } - return new DatastoreException(code, message, reason); + return new DatastoreException(code, message, reason, exception); } @Override