mirror of
https://github.com/NixOS/nix.git
synced 2025-10-14 02:19:32 +08:00
util/error: Document addTrace params
... and rename e -> pos. That was weird.
This commit is contained in:
@@ -192,13 +192,23 @@ public:
|
||||
err.traces.push_front(trace);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param pos Nullable `shared_ptr<Pos>`
|
||||
* @param fs Format string, see `HintFmt`
|
||||
* @param args... Format string arguments.
|
||||
*/
|
||||
template<typename... Args>
|
||||
void addTrace(std::shared_ptr<const Pos> && e, std::string_view fs, const Args &... args)
|
||||
void addTrace(std::shared_ptr<const Pos> && pos, std::string_view fs, const Args &... args)
|
||||
{
|
||||
addTrace(std::move(e), HintFmt(std::string(fs), args...));
|
||||
addTrace(std::move(pos), HintFmt(std::string(fs), args...));
|
||||
}
|
||||
|
||||
void addTrace(std::shared_ptr<const Pos> && e, HintFmt hint, TracePrint print = TracePrint::Default);
|
||||
/**
|
||||
* @param pos Nullable `shared_ptr<Pos>`
|
||||
* @param hint Formatted error message
|
||||
* @param print Optional, whether to always print (e.g. `addErrorContext`)
|
||||
*/
|
||||
void addTrace(std::shared_ptr<const Pos> && pos, HintFmt hint, TracePrint print = TracePrint::Default);
|
||||
|
||||
bool hasTrace() const
|
||||
{
|
||||
|
Reference in New Issue
Block a user