mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-29 09:06:15 +02: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
1 changed files with 1 additions and 1 deletions
|
@ -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