Skip to content

Commit a0f2d20

Browse files
committed
Set special reason for timeout exceptions
1 parent 0a05851 commit a0f2d20

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

gcloud-java-datastore/src/main/java/com/google/gcloud/spi/DefaultDatastoreRpc.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,12 @@ private static DatastoreRpcException translate(DatastoreException exception) {
126126
return new DatastoreRpcException(reason);
127127
} else {
128128
boolean retryable = false;
129+
reasonStr = "Unknown";
129130
if (exception.getCause() instanceof SocketTimeoutException) {
130131
retryable = true;
132+
reasonStr = "Request timeout";
131133
}
132-
return new DatastoreRpcException("Unknown", exception.getCode(), retryable, message);
134+
return new DatastoreRpcException(reasonStr, exception.getCode(), retryable, message);
133135
}
134136
}
135137

0 commit comments

Comments
 (0)