Skip to content

Commit 73e31f6

Browse files
committed
Rephrase wording on giterr_last documentation
1 parent 3602b57 commit 73e31f6

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

docs/error-handling.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,11 @@ The public error API
117117
the last error. This may return NULL if no error has occurred.
118118
Otherwise this should return a `git_error` object indicating the class
119119
of error and the error message that was generated by the library.
120-
Do not use this method unless you received an error, it will
121-
lead to undefined behaviour.
120+
Do not use this function unless the prior call to a libgit2 API
121+
returned an error, as it can give misleading results.
122+
libgit2's error strings are not cleared aggressively,
123+
and this function may return an error string that reflects a prior error,
124+
possibly even reflecting internal state.
122125
123126
The last error is stored in thread-local storage when libgit2 is
124127
compiled with thread support, so you do not have to worry about another

0 commit comments

Comments
 (0)