Skip to content

Commit c874e70

Browse files
committed
libstore/http-binary-cache-store: Improve error messages in HttpBinaryCacheStore::upsertFile
Now the error message doesn't cram everything into a single line and we now instead get: error: … while uploading to HTTP binary cache at 's3://my-cache?endpoint=http://localhost:9000?compression%3Dzstd&region=eu-west-1' error: unable to download 'http://localhost:9000/my-cache/nar/1125zqba8cx8wbfa632vy458a3j3xja0qpcqafsfdildyl9dqa7x.nar.xz': Operation was aborted by an application callback (42)
1 parent 70176ed commit c874e70

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/libstore/http-binary-cache-store.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ void HttpBinaryCacheStore::upsertFile(
157157
try {
158158
getFileTransfer()->upload(req);
159159
} catch (FileTransferError & e) {
160-
throw UploadToHTTP("while uploading to HTTP binary cache at '%s': %s", config->cacheUri.to_string(), e.msg());
160+
UploadToHTTP err(e.message());
161+
err.addTrace({}, "while uploading to HTTP binary cache at '%s'", config->cacheUri.to_string());
162+
throw err;
161163
}
162164
}
163165

0 commit comments

Comments
 (0)