summaryrefslogtreecommitdiff
path: root/include/git2/errors.h
diff options
context:
space:
mode:
authorVicent Martí <tanoku@gmail.com>2012-03-14 17:41:04 -0700
committerVicent Martí <tanoku@gmail.com>2012-03-14 17:41:04 -0700
commite24fbba94862fdb602846771f2ae41ef15834d10 (patch)
tree4b11910d7d315a6db667cc4af4c6749630612ed3 /include/git2/errors.h
parentdda708e78f3c3f43d814d46c29ab9f2b9d47ed5c (diff)
parentdeafee7bd7a9e2efcdff90627b6094d8c1519319 (diff)
downloadlibgit2-e24fbba94862fdb602846771f2ae41ef15834d10.tar.gz
Merge pull request #595 from arrbee/new-errors-odb
Update odb code to new error handling
Diffstat (limited to 'include/git2/errors.h')
-rw-r--r--include/git2/errors.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/include/git2/errors.h b/include/git2/errors.h
index 085dd52f0..5a4e540e1 100644
--- a/include/git2/errors.h
+++ b/include/git2/errors.h
@@ -103,7 +103,7 @@ typedef enum {
GIT_EOBJCORRUPTED = -28,
/** The given short oid is ambiguous */
- GIT_EAMBIGUOUSOIDPREFIX = -29,
+ GIT_EAMBIGUOUS = -29,
/** Skip and passthrough the given ODB backend */
GIT_EPASSTHROUGH = -30,
@@ -128,11 +128,13 @@ typedef enum {
GITERR_REPOSITORY,
GITERR_CONFIG,
GITERR_REGEX,
+ GITERR_ODB
} git_error_class;
/**
* 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);
@@ -144,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
*/
@@ -151,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