diff --git a/gcloud-java-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryException.java b/gcloud-java-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryException.java index 501ec1e809e2..0b0c7d3152e3 100644 --- a/gcloud-java-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryException.java +++ b/gcloud-java-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryException.java @@ -31,7 +31,7 @@ * @see Google Cloud * BigQuery error codes */ -public class BigQueryException extends BaseServiceException { +public final class BigQueryException extends BaseServiceException { // see: https://cloud.google.com/bigquery/troubleshooting-errors private static final Set RETRYABLE_ERRORS = ImmutableSet.of( @@ -47,12 +47,12 @@ public BigQueryException(int code, String message) { this(code, message, (Throwable) null); } - BigQueryException(int code, String message, Throwable cause) { + public BigQueryException(int code, String message, Throwable cause) { super(code, message, null, true, cause); this.error = null; } - BigQueryException(int code, String message, BigQueryError error) { + public BigQueryException(int code, String message, BigQueryError error) { super(code, message, error != null ? error.reason() : null, true); this.error = error; } diff --git a/gcloud-java-datastore/src/main/java/com/google/cloud/datastore/DatastoreException.java b/gcloud-java-datastore/src/main/java/com/google/cloud/datastore/DatastoreException.java index de04a0a563f2..42c0079e0a77 100644 --- a/gcloud-java-datastore/src/main/java/com/google/cloud/datastore/DatastoreException.java +++ b/gcloud-java-datastore/src/main/java/com/google/cloud/datastore/DatastoreException.java @@ -30,14 +30,14 @@ * @see Google Cloud * Datastore error codes */ -public class DatastoreException extends BaseServiceException { +public final class DatastoreException extends BaseServiceException { // see https://cloud.google.com/datastore/docs/concepts/errors#Error_Codes" private static final Set RETRYABLE_ERRORS = ImmutableSet.of( new Error(10, "ABORTED"), new Error(4, "DEADLINE_EXCEEDED"), new Error(14, "UNAVAILABLE")); private static final long serialVersionUID = 2663750991205874435L; - DatastoreException(int code, String message, String reason) { + public DatastoreException(int code, String message, String reason) { this(code, message, reason, null); } diff --git a/gcloud-java-dns/src/main/java/com/google/cloud/dns/DnsException.java b/gcloud-java-dns/src/main/java/com/google/cloud/dns/DnsException.java index ef183aa39d0c..90c32aee1681 100644 --- a/gcloud-java-dns/src/main/java/com/google/cloud/dns/DnsException.java +++ b/gcloud-java-dns/src/main/java/com/google/cloud/dns/DnsException.java @@ -28,7 +28,7 @@ /** * DNS service exception. */ -public class DnsException extends BaseServiceException { +public final class DnsException extends BaseServiceException { // see: https://cloud.google.com/dns/troubleshooting private static final Set RETRYABLE_ERRORS = ImmutableSet.of( @@ -48,7 +48,7 @@ public DnsException(GoogleJsonError error, boolean idempotent) { super(error, idempotent); } - DnsException(int code, String message, Throwable cause) { + public DnsException(int code, String message, Throwable cause) { super(code, message, null, true, cause); } diff --git a/gcloud-java-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManagerException.java b/gcloud-java-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManagerException.java index a916eefd86a4..2a6906fc0090 100644 --- a/gcloud-java-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManagerException.java +++ b/gcloud-java-resourcemanager/src/main/java/com/google/cloud/resourcemanager/ResourceManagerException.java @@ -30,7 +30,7 @@ * @see Google Cloud * Resource Manager error codes */ -public class ResourceManagerException extends BaseServiceException { +public final class ResourceManagerException extends BaseServiceException { // see https://cloud.google.com/resource-manager/v1/errors/core_errors private static final Set RETRYABLE_ERRORS = ImmutableSet.of( @@ -47,11 +47,11 @@ public class ResourceManagerException extends BaseServiceException { new Error(403, "variableTermLimitExceeded")); private static final long serialVersionUID = -9207194488966554136L; - ResourceManagerException(int code, String message) { + public ResourceManagerException(int code, String message) { this(code, message, null); } - ResourceManagerException(int code, String message, Throwable cause) { + public ResourceManagerException(int code, String message, Throwable cause) { super(code, message, null, true, cause); } diff --git a/gcloud-java-storage/src/main/java/com/google/cloud/storage/StorageException.java b/gcloud-java-storage/src/main/java/com/google/cloud/storage/StorageException.java index 89690090369d..e0dcd8df0946 100644 --- a/gcloud-java-storage/src/main/java/com/google/cloud/storage/StorageException.java +++ b/gcloud-java-storage/src/main/java/com/google/cloud/storage/StorageException.java @@ -31,7 +31,7 @@ * @see Google Cloud * Storage error codes */ -public class StorageException extends BaseServiceException { +public final class StorageException extends BaseServiceException { // see: https://cloud.google.com/storage/docs/resumable-uploads-xml#practices private static final Set RETRYABLE_ERRORS = ImmutableSet.of( @@ -49,7 +49,7 @@ public StorageException(int code, String message) { this(code, message, null); } - StorageException(int code, String message, Throwable cause) { + public StorageException(int code, String message, Throwable cause) { super(code, message, null, true, cause); }