mirror of
https://github.com/NixOS/nix
synced 2025-06-28 01:11:15 +02:00
implement SysError errno handling
This commit is contained in:
parent
7ffb5efdbc
commit
e76ad2e48a
5 changed files with 21 additions and 19 deletions
|
@ -160,13 +160,14 @@ public:
|
|||
|
||||
template<typename... Args>
|
||||
SysError(const Args & ... args)
|
||||
: Error(args...) // TODO addErrNo for hintfmt
|
||||
// : Error(addErrno(hintfmt(args...)))
|
||||
{ }
|
||||
:Error("")
|
||||
{
|
||||
errNo = errno;
|
||||
auto hf = hintfmt(args...);
|
||||
err.hint = hintfmt("%1% : %2%", normaltxt(hf.str()), strerror(errNo));
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
std::string addErrno(const std::string & s);
|
||||
virtual const char* sname() const override { return "SysError"; }
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue