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:
parent
583f5e37fc
commit
0fd890a8d6
4 changed files with 9 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue