1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00

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)
This commit is contained in:
Sergei Zimmerman 2025-10-29 01:47:18 +03:00
parent 70176ed317
commit c874e7071b
No known key found for this signature in database

View file

@ -157,7 +157,9 @@ void HttpBinaryCacheStore::upsertFile(
try {
getFileTransfer()->upload(req);
} catch (FileTransferError & e) {
throw UploadToHTTP("while uploading to HTTP binary cache at '%s': %s", config->cacheUri.to_string(), e.msg());
UploadToHTTP err(e.message());
err.addTrace({}, "while uploading to HTTP binary cache at '%s'", config->cacheUri.to_string());
throw err;
}
}