You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 11, 2024. It is now read-only.
Add URL to storage exceptions since error responses usually only have something generic like 'not found' which require seeing the URL to understand. (#509)
Copy file name to clipboardExpand all lines: common/google-cloud/cloud-storage/src/main/java/org/curioswitch/curiostack/gcloud/storage/StorageClient.java
+7-4Lines changed: 7 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -130,7 +130,9 @@ public CompletableFuture<FileWriter> createFile(
130
130
ResponseHeadersresponseHeaders = msg.headers();
131
131
if (!responseHeaders.status().equals(HttpStatus.OK)) {
132
132
thrownewRuntimeException(
133
-
"Non-successful response when creating new file: "
133
+
"Non-successful response when creating new file at "
134
+
+ uploadUrl
135
+
+ ": "
134
136
+ responseHeaders
135
137
+ "\n"
136
138
+ msg.content().toStringUtf8());
@@ -172,7 +174,8 @@ public CompletableFuture<ByteBuf> readFile(
172
174
if (!msg.status().equals(HttpStatus.OK)) {
173
175
Stringresponse = msg.contentUtf8();
174
176
ReferenceCountUtil.safeRelease(msg.content());
175
-
thrownewInvalidResponseException("Could not fetch file: " + response);
177
+
thrownewInvalidResponseException(
178
+
"Could not fetch file at " + filename + ": " + response);
176
179
}
177
180
HttpDatadata = msg.content();
178
181
if (datainstanceofByteBufHolder) {
@@ -231,7 +234,7 @@ public CompletableFuture<Void> delete(String filename) {
231
234
returnnull;
232
235
} else {
233
236
thrownewIllegalStateException(
234
-
"Could not delete file: " + msg.content().toStringUtf8());
237
+
"Could not delete file at " + url + ": " + msg.content().toStringUtf8());
0 commit comments