aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/globals.cc
diff options
context:
space:
mode:
authorregnat <rg@regnat.ovh>2021-02-19 17:58:28 +0100
committerregnat <rg@regnat.ovh>2021-02-25 17:19:59 +0100
commitf67ff1f5756018387a2d23c8f6772580192d30ad (patch)
treed2b1f6d05b01eb52c36898903424882c150ee0bf /src/libstore/globals.cc
parentaead35531a0630b19e41348e103b2d105e2d8dd9 (diff)
Don't crash when copying realisations to a non-ca remote
Rather throw a proper exception, and catch&log it on the client side
Diffstat (limited to 'src/libstore/globals.cc')
-rw-r--r--src/libstore/globals.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc
index 2780e0bf5..8d44003f4 100644
--- a/src/libstore/globals.cc
+++ b/src/libstore/globals.cc
@@ -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()