summaryrefslogtreecommitdiff
path: root/include/git2/errors.h
diff options
context:
space:
mode:
authorVicent Martí <vicent@github.com>2013-11-05 06:05:32 -0800
committerVicent Martí <vicent@github.com>2013-11-05 06:05:32 -0800
commitffd040532a1f3c7f4e268be682bb91fe724693be (patch)
tree4a283f083fe2fe0c0678a6209a19b9a29f2c8f51 /include/git2/errors.h
parentb7fbfbb21f4248bf4103a2c13479bf65ba175f36 (diff)
parent1eab9f0e32178a9aac941583c69e1b9cf9849f77 (diff)
downloadlibgit2-ffd040532a1f3c7f4e268be682bb91fe724693be.tar.gz
Merge pull request #1941 from libgit2/rb/preserve-iterator-error
Preserve error messages during file system iterator cleanup
Diffstat (limited to 'include/git2/errors.h')
-rw-r--r--include/git2/errors.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/git2/errors.h b/include/git2/errors.h
index a454ac956..be7a31d8e 100644
--- a/include/git2/errors.h
+++ b/include/git2/errors.h
@@ -8,6 +8,7 @@
#define INCLUDE_git_errors_h__
#include "common.h"
+#include "buffer.h"
/**
* @file git2/errors.h
@@ -45,6 +46,7 @@ typedef struct {
/** Error classes */
typedef enum {
+ GITERR_NONE = 0,
GITERR_NOMEMORY,
GITERR_OS,
GITERR_INVALID,
@@ -85,6 +87,18 @@ GIT_EXTERN(const git_error *) giterr_last(void);
GIT_EXTERN(void) giterr_clear(void);
/**
+ * Get the last error data and clear it.
+ *
+ * This copies the last error into the given `git_error` struct
+ * and returns 0 if the copy was successful, leaving the error
+ * cleared as if `giterr_clear` had been called.
+ *
+ * If there was no existing error in the library, -1 will be returned
+ * and the contents of `cpy` will be left unmodified.
+ */
+GIT_EXTERN(int) giterr_detach(git_error *cpy);
+
+/**
* Set the error message string for this thread.
*
* This function is public so that custom ODB backends and the like can