![]() |
Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
|
#include <optional>#include "nix/util/ansicolor.hh"#include "nix/util/configuration.hh"#include "nix/util/error.hh"#include "nix/util/logging.hh"Go to the source code of this file.
Enumerations | |
| enum struct | nix::Diagnose { Ignore , Warn , Fatal } |
Functions | |
| template<typename F> | |
| void | nix::diagnose (const Setting< Diagnose > &setting, const F &mkError) |
|
strong |
Check a diagnostic setting and either do nothing, log a warning, or throw an error.
The setting name is automatically appended to the error message.
| setting | The diagnostic setting to check |
| mkError | A function that takes a bool (true if fatal, false if warning) and returns an optional error to throw (or warn with). Only called if level is not Ignore. If the function returns std::nullopt, no diagnostic is emitted. |
| The | error returned by mkError if level is Fatal and mkError returns a value |