diff options
author | Vicent Martà <tanoku@gmail.com> | 2012-02-14 21:23:11 +0100 |
---|---|---|
committer | Vicent Martà <tanoku@gmail.com> | 2012-03-03 02:28:00 +0100 |
commit | 60bc2d20c40e37e92e4e15479ac4dccbde069bec (patch) | |
tree | 0c64df89b9cd66090e2c1665a9a21b19a7113a57 /include/git2/errors.h | |
parent | 845f8314e4a02cbd01b2e7d8a6d608d9e9a1334d (diff) | |
download | libgit2-60bc2d20c40e37e92e4e15479ac4dccbde069bec.tar.gz |
error-handling: Add new routines
Obviously all the old throw routines are still in place, so we can
gradually port over.
Diffstat (limited to 'include/git2/errors.h')
-rw-r--r-- | include/git2/errors.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/git2/errors.h b/include/git2/errors.h index f617986e..54da869b 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -113,8 +113,23 @@ typedef enum { /** The buffer is too short to satisfy the request */ GIT_ESHORTBUFFER = -32, +} git_error_t; + +typedef struct { + char *message; + int klass; } git_error; +typedef enum { + GITERR_NOMEMORY, + +} git_error_class; + +GIT_EXTERN(void) giterr_set(git_error **error_out, int error_class, const char *string, ...); +GIT_EXTERN(void) giterr_set_oom(git_error **error); +GIT_EXTERN(void) giterr_free(git_error *error); +GIT_EXTERN(void) giterr_clear(git_error **error); + /** * Return a detailed error string with the latest error * that occurred in the library. |