1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00

Store reason as a field in MissingExperimentalFeature

Store the reason string as a field in the exception class rather than
only embedding it in the error message. This supports better structured
error handling and future JSON error reporting.

Suggested by Ericson2314 in PR review.
This commit is contained in:
Robert Hensing 2025-10-13 23:48:58 +02:00
parent 71aa9a4798
commit 39c4665488
2 changed files with 3 additions and 0 deletions

View file

@ -383,6 +383,7 @@ MissingExperimentalFeature::MissingExperimentalFeature(ExperimentalFeature featu
showExperimentalFeature(feature),
Uncolored(optionalBracket(" (", reason, ")")))
, missingFeature(feature)
, reason{reason}
{
}

View file

@ -88,6 +88,8 @@ public:
*/
ExperimentalFeature missingFeature;
std::string reason;
MissingExperimentalFeature(ExperimentalFeature missingFeature, std::string reason = "");
};