mirror of
https://github.com/NixOS/nix.git
synced 2025-11-16 07:22:43 +01:00
util/error: Document addTrace params
... and rename e -> pos. That was weird.
This commit is contained in:
parent
f77094715f
commit
6db86389ce
1 changed files with 13 additions and 3 deletions
|
|
@ -192,13 +192,23 @@ public:
|
||||||
err.traces.push_front(trace);
|
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>
|
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
|
bool hasTrace() const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue