diff options
author | Russell Belfer <arrbee@arrbee.com> | 2012-03-13 14:23:24 -0700 |
---|---|---|
committer | Russell Belfer <arrbee@arrbee.com> | 2012-03-13 14:23:24 -0700 |
commit | e3c475107045cb89c53c114716bafebc7538433f (patch) | |
tree | eb6df56dc41633a30a935058477e45b8e39ef77a /include/git2/errors.h | |
parent | 1736799d2a15d912cfc46b7089c2bff02a1cbd0e (diff) | |
download | libgit2-e3c475107045cb89c53c114716bafebc7538433f.tar.gz |
Resolve comments from pull request
This converts the map validation function into a macro, tweaks
the GITERR_OS system error automatic appending, and adds a
tentative new error access API and some quick unit tests for
both the old and new error APIs.
Diffstat (limited to 'include/git2/errors.h')
-rw-r--r-- | include/git2/errors.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/git2/errors.h b/include/git2/errors.h index cd9dc08e..5a4e540e 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -134,6 +134,7 @@ typedef enum { /** * Return a detailed error string with the latest error * that occurred in the library. + * @deprecated This will be replaced in the new error handling * @return a string explaining the error */ GIT_EXTERN(const char *) git_lasterror(void); @@ -145,6 +146,7 @@ GIT_EXTERN(const char *) git_lasterror(void); * NOTE: This method will be eventually deprecated in favor * of the new `git_lasterror`. * + * @deprecated This will be replaced in the new error handling * @param num The error code to explain * @return a string explaining the error code */ @@ -152,9 +154,23 @@ GIT_EXTERN(const char *) git_strerror(int num); /** * Clear the latest library error + * @deprecated This will be replaced in the new error handling */ GIT_EXTERN(void) git_clearerror(void); +/** + * Return the last `git_error` object that was generated for the + * current thread or NULL if no error has occurred. + * + * @return A git_error object. + */ +GIT_EXTERN(const git_error *) git_error_last(void); + +/** + * Clear the last library error that occurred for this thread. + */ +GIT_EXTERN(void) git_error_clear(void); + /** @} */ GIT_END_DECL #endif |