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:
parent
71aa9a4798
commit
39c4665488
2 changed files with 3 additions and 0 deletions
|
|
@ -383,6 +383,7 @@ MissingExperimentalFeature::MissingExperimentalFeature(ExperimentalFeature featu
|
|||
showExperimentalFeature(feature),
|
||||
Uncolored(optionalBracket(" (", reason, ")")))
|
||||
, missingFeature(feature)
|
||||
, reason{reason}
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -88,6 +88,8 @@ public:
|
|||
*/
|
||||
ExperimentalFeature missingFeature;
|
||||
|
||||
std::string reason;
|
||||
|
||||
MissingExperimentalFeature(ExperimentalFeature missingFeature, std::string reason = "");
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue