summaryrefslogtreecommitdiff
path: root/docs/error-handling.md
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2018-08-30 12:22:26 +0200
committerGitHub <noreply@github.com>2018-08-30 12:22:26 +0200
commitdb0c66483decd65b0eda5bc8a08e34c1682b98a9 (patch)
treea8099dcc8638c175651a820236503e981263ff2a /docs/error-handling.md
parentdf2f276e41f8b21f518f621043b99f2b34c109fb (diff)
parentc0b2e5256ca3580b8c0fd2e6b04ae1c27d692e2e (diff)
downloadlibgit2-db0c66483decd65b0eda5bc8a08e34c1682b98a9.tar.gz
Merge pull request #4773 from RandomSort/giterr
Document giterr_last() use only after error. #4772
Diffstat (limited to 'docs/error-handling.md')
-rw-r--r--docs/error-handling.md5
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/error-handling.md b/docs/error-handling.md
index 719244d2f..0dba01cd9 100644
--- a/docs/error-handling.md
+++ b/docs/error-handling.md
@@ -117,6 +117,11 @@ The public error API
the last error. This may return NULL if no error has occurred.
Otherwise this should return a `git_error` object indicating the class
of error and the error message that was generated by the library.
+ Do not use this function unless the prior call to a libgit2 API
+ returned an error, as it can otherwise give misleading results.
+ libgit2's error strings are not cleared aggressively,
+ and this function may return an error string that reflects a prior error,
+ possibly even reflecting internal state.
The last error is stored in thread-local storage when libgit2 is
compiled with thread support, so you do not have to worry about another