NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
11.97k stars 1.47k forks source link

C API: document error handling #11017

Open ehmry opened 1 month ago

ehmry commented 1 month ago

The documentation on the C API should also include error handling because there are too many ways to imagine how it works. If a procedure returns nix_err I don't know if that means without a context it will just throw an exception, and if a context is set I don't know if the context will carry the same error as the one returned.

Perhaps it would be useful to handler errors at a context using a callback? This would allow bindings to throw errors as their own native exceptions.

roberth commented 1 month ago

It looks like the main page is broken

We do have this, but we can't really expect anyone to find it without a main page.