aboutsummaryrefslogtreecommitdiff
path: root/src/libutil
diff options
context:
space:
mode:
authorThéophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>2022-07-22 13:27:52 +0200
committerGitHub <noreply@github.com>2022-07-22 13:27:52 +0200
commit280543933507839201547f831280faac614d0514 (patch)
tree9d00d932e63e3aceccfbd60e01e34425727626c8 /src/libutil
parente10807cdbbf3d60a8e82e0c31bcbd5ca7aaa4664 (diff)
parent36e1383b6b32abd414c8402dd66f7ef78f93f4e1 (diff)
Merge pull request #6814 from amjoseph-nixpkgs/pr/sandbox-error-messages
local-derivation-goal.cc: improve error messages when sandboxing fails
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/error.hh10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libutil/error.hh b/src/libutil/error.hh
index a53e9802e..3d1479c54 100644
--- a/src/libutil/error.hh
+++ b/src/libutil/error.hh
@@ -204,13 +204,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 ...)
+ {
+ }
};
}