mirror of
https://github.com/NixOS/nix
synced 2025-06-29 19:03:16 +02:00
Don't crash when copying realisations to a non-ca remote
Rather throw a proper exception, and catch&log it on the client side
This commit is contained in:
parent
aead35531a
commit
f67ff1f575
4 changed files with 33 additions and 7 deletions
|
@ -165,10 +165,15 @@ bool Settings::isExperimentalFeatureEnabled(const std::string & name)
|
|||
return std::find(f.begin(), f.end(), name) != f.end();
|
||||
}
|
||||
|
||||
MissingExperimentalFeature::MissingExperimentalFeature(std::string feature)
|
||||
: Error("experimental Nix feature '%1%' is disabled; use '--experimental-features %1%' to override", feature)
|
||||
, missingFeature(feature)
|
||||
{}
|
||||
|
||||
void Settings::requireExperimentalFeature(const std::string & name)
|
||||
{
|
||||
if (!isExperimentalFeatureEnabled(name))
|
||||
throw Error("experimental Nix feature '%1%' is disabled; use '--experimental-features %1%' to override", name);
|
||||
throw MissingExperimentalFeature(name);
|
||||
}
|
||||
|
||||
bool Settings::isWSL1()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue