mirror of
https://github.com/NixOS/nix.git
synced 2025-11-16 15:32:43 +01:00
HttpBinaryCacheStore: Improve error message for unauthorized caches
Instead of the unhelpful warning: 'https://cache.flakehub.com' does not appear to be a binary cache you now get warning: unable to download 'https://cache.flakehub.com/nix-cache-info': HTTP error 401 response body: {"code":401,"error":"Unauthorized","message":"Unauthorized."}
This commit is contained in:
parent
ff00eebb16
commit
3b21ea40cc
3 changed files with 29 additions and 5 deletions
|
|
@ -64,6 +64,8 @@ protected:
|
|||
// The prefix under which realisation infos will be stored
|
||||
const std::string realisationsPrefix = "realisations";
|
||||
|
||||
const std::string cacheInfoFile = "nix-cache-info";
|
||||
|
||||
BinaryCacheStore(const Params & params);
|
||||
|
||||
public:
|
||||
|
|
@ -84,6 +86,12 @@ public:
|
|||
*/
|
||||
virtual void getFile(const std::string & path, Sink & sink);
|
||||
|
||||
/**
|
||||
* Get the contents of /nix-cache-info. Return std::nullopt if it
|
||||
* doesn't exist.
|
||||
*/
|
||||
virtual std::optional<std::string> getNixCacheInfo();
|
||||
|
||||
/**
|
||||
* Fetch the specified file and call the specified callback with
|
||||
* the result. A subclass may implement this asynchronously.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue