summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/errors.h13
-rw-r--r--include/git2/types.h9
2 files changed, 21 insertions, 1 deletions
diff --git a/include/git2/errors.h b/include/git2/errors.h
index 5ac0d5b27..db71fc2ef 100644
--- a/include/git2/errors.h
+++ b/include/git2/errors.h
@@ -8,6 +8,7 @@
#define INCLUDE_git_errors_h__
#include "common.h"
+#include "types.h"
/**
* @file git2/errors.h
@@ -113,7 +114,7 @@ typedef enum {
/** The buffer is too short to satisfy the request */
GIT_ESHORTBUFFER = -32,
-} git_error;
+} git_error_code;
/**
* Return a detailed error string with the latest error
@@ -139,6 +140,16 @@ GIT_EXTERN(const char *) git_strerror(int num);
*/
GIT_EXTERN(void) git_clearerror(void);
+GIT_EXTERN(void) git_error_free(git_error *err);
+
+/**
+ * Print a stack trace to stderr
+ *
+ * A bog standard stack trace. You can use it if you don't want to do
+ * anything more complex in your UI.
+ */
+GIT_EXTERN(void) git_error_print_stack(git_error *error_in);
+
/** @} */
GIT_END_DECL
#endif
diff --git a/include/git2/types.h b/include/git2/types.h
index 1df18974a..03b5fcf3b 100644
--- a/include/git2/types.h
+++ b/include/git2/types.h
@@ -131,6 +131,15 @@ typedef struct git_reflog_entry git_reflog_entry;
/** Representation of a reference log */
typedef struct git_reflog git_reflog;
+/** Represensation of a git_error */
+typedef struct git_error {
+ int code;
+ char *msg;
+ struct git_error *child;
+ const char *file;
+ unsigned int line;
+} git_error;
+
/** Time in a signature */
typedef struct git_time {
git_time_t time; /** time in seconds from epoch */