mirror of
https://github.com/NixOS/nix
synced 2024-09-19 23:03:53 -04:00
nix_api_util: throw nix::error instead of new nix::Error for null ctx's
This commit is contained in:
parent
e74d6c1b3d
commit
f0afe7f9b9
|
@ -43,7 +43,7 @@ nix_err nix_context_error(nix_c_context *context) {
|
||||||
nix_err nix_set_err_msg(nix_c_context *context, nix_err err, const char *msg) {
|
nix_err nix_set_err_msg(nix_c_context *context, nix_err err, const char *msg) {
|
||||||
if (context == nullptr) {
|
if (context == nullptr) {
|
||||||
// todo last_err_code
|
// todo last_err_code
|
||||||
throw new nix::Error("Nix C api error", msg);
|
throw nix::Error("Nix C api error: %s", msg);
|
||||||
}
|
}
|
||||||
context->last_err_code = err;
|
context->last_err_code = err;
|
||||||
context->last_err = msg;
|
context->last_err = msg;
|
||||||
|
|
Loading…
Reference in a new issue