mirror of
https://github.com/NixOS/nix
synced 2025-06-25 14:51:16 +02:00
WIP: broken merge but need a git checkpoint
This commit is contained in:
commit
eb460a9529
241 changed files with 7587 additions and 2694 deletions
|
@ -98,6 +98,15 @@ struct ErrPos {
|
|||
}
|
||||
};
|
||||
|
||||
std::optional<LinesOfCode> getCodeLines(const ErrPos & errPos);
|
||||
|
||||
void printCodeLines(std::ostream & out,
|
||||
const std::string & prefix,
|
||||
const ErrPos & errPos,
|
||||
const LinesOfCode & loc);
|
||||
|
||||
void printAtPos(const ErrPos & pos, std::ostream & out);
|
||||
|
||||
struct Trace {
|
||||
std::optional<ErrPos> pos;
|
||||
hintformat hint;
|
||||
|
@ -201,13 +210,19 @@ public:
|
|||
int errNo;
|
||||
|
||||
template<typename... Args>
|
||||
SysError(const Args & ... args)
|
||||
SysError(int errNo_, const Args & ... args)
|
||||
: Error("")
|
||||
{
|
||||
errNo = errno;
|
||||
errNo = errNo_;
|
||||
auto hf = hintfmt(args...);
|
||||
err.msg = hintfmt("%1%: %2%", normaltxt(hf.str()), strerror(errNo));
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
SysError(const Args & ... args)
|
||||
: SysError(errno, args ...)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue