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:
parent
3d79f38709
commit
ab9250286a
5 changed files with 30 additions and 21 deletions
|
@ -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);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue