aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/globals.cc
diff options
context:
space:
mode:
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()