Skip to content

Commit 6db8638

Browse files
committed
util/error: Document addTrace params
... and rename e -> pos. That was weird.
1 parent f770947 commit 6db8638

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/libutil/include/nix/util/error.hh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,23 @@ public:
192192
err.traces.push_front(trace);
193193
}
194194

195+
/**
196+
* @param pos Nullable `shared_ptr<Pos>`
197+
* @param fs Format string, see `HintFmt`
198+
* @param args... Format string arguments.
199+
*/
195200
template<typename... Args>
196-
void addTrace(std::shared_ptr<const Pos> && e, std::string_view fs, const Args &... args)
201+
void addTrace(std::shared_ptr<const Pos> && pos, std::string_view fs, const Args &... args)
197202
{
198-
addTrace(std::move(e), HintFmt(std::string(fs), args...));
203+
addTrace(std::move(pos), HintFmt(std::string(fs), args...));
199204
}
200205

201-
void addTrace(std::shared_ptr<const Pos> && e, HintFmt hint, TracePrint print = TracePrint::Default);
206+
/**
207+
* @param pos Nullable `shared_ptr<Pos>`
208+
* @param hint Formatted error message
209+
* @param print Optional, whether to always print (e.g. `addErrorContext`)
210+
*/
211+
void addTrace(std::shared_ptr<const Pos> && pos, HintFmt hint, TracePrint print = TracePrint::Default);
202212

203213
bool hasTrace() const
204214
{

0 commit comments

Comments
 (0)