1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-04 08:00:59 +01:00

Add reason string support to MissingExperimentalFeature

This commit is contained in:
Robert Hensing 2025-10-13 14:09:49 +02:00
parent 583f5e37fc
commit 0fd890a8d6
4 changed files with 9 additions and 7 deletions

View file

@ -500,10 +500,10 @@ bool ExperimentalFeatureSettings::isEnabled(const ExperimentalFeature & feature)
return std::find(f.begin(), f.end(), feature) != f.end();
}
void ExperimentalFeatureSettings::require(const ExperimentalFeature & feature) const
void ExperimentalFeatureSettings::require(const ExperimentalFeature & feature, std::string reason) const
{
if (!isEnabled(feature))
throw MissingExperimentalFeature(feature);
throw MissingExperimentalFeature(feature, std::move(reason));
}
bool ExperimentalFeatureSettings::isEnabled(const std::optional<ExperimentalFeature> & feature) const