1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 13:41:15 +02:00

C API: add a way to throw errors from primops

This commit is contained in:
Yorick van Pelt 2023-08-28 22:19:28 +02:00 committed by José Luis Lafuente
parent 3d79f38709
commit ab9250286a
No known key found for this signature in database
GPG key ID: 8A3455EBE455489A
5 changed files with 30 additions and 21 deletions

View file

@ -263,6 +263,20 @@ nix_err nix_err_name(nix_c_context * context, const nix_c_context * read_context
*/
nix_err nix_err_code(const nix_c_context * read_context);
/**
* @brief Set an error message on a nix context.
*
* This should be used when you want to throw an error from a PrimOp callback.
*
* All other use is internal to the API.
*
* @param context context to write the error message to, or NULL
* @param err The error code to set and return
* @param msg The error message to set.
* @returns the error code set
*/
nix_err nix_set_err_msg(nix_c_context * context, nix_err err, const char * msg);
/**
* @}
*/