2.16 Errors
(require libgit2/include/errors) | package: libgit2 |
procedure
(giterr_clear) → void?
procedure
(giterr_set_oom) → void?
The normal giterr_set_str() function attempts to strdup() the string that is passed in. This is not a good idea when the error in question is a memory allocation failure. That circumstance has a special setter function that sets the error string to a known and statically allocated internal value.
This function is public so that custom ODB backends and the like can relay an error message through libgit2. Most regular users of libgit2 will never need to call this function – actually, calling it in most circumstances (for example, calling from within a callback function) will just end up having the value overwritten by libgit2 internals.
This error message is stored in thread-local storage and only applies to the particular thread that this libgit2 call is made from.