Skip to content

Commit e23de1e

Browse files
CloudStorageReadChannel: more detailed error messages when retries/reopens are exhausted
1 parent 19262b7 commit e23de1e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStorageReadChannel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public int read(ByteBuffer dst) throws IOException {
120120
// but here at this higher level we can retry them.
121121
reopens++;
122122
if (reopens > maxChannelReopens) {
123-
throw new StorageException(exs.getCode(), "All reopens failed", exs);
123+
throw new StorageException(exs.getCode(), "All " + maxChannelReopens + " reopens failed", exs);
124124
}
125125
sleepForAttempt(reopens);
126126
innerOpen();
@@ -134,7 +134,7 @@ public int read(ByteBuffer dst) throws IOException {
134134
// "While in principle you should be able to retry, we already did that
135135
// for you a few times and it still didn't work so we wouldn't recommend
136136
// further retries."
137-
throw new StorageException(exs.getCode(), "All retries failed", exs);
137+
throw new StorageException(exs.getCode(), "All " + maxRetries + " retries failed", exs);
138138
}
139139
sleepForAttempt(retries);
140140
continue;

0 commit comments

Comments
 (0)