summaryrefslogtreecommitdiff
path: root/include/git2/errors.h
diff options
context:
space:
mode:
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