diff options
author | Vicent Martà <tanoku@gmail.com> | 2012-02-15 16:54:17 +0100 |
---|---|---|
committer | Vicent Martà <tanoku@gmail.com> | 2012-03-03 02:28:50 +0100 |
commit | 45d387ac78bcf3167d69b736d0b322717bc492d4 (patch) | |
tree | 85f5568c2007a1e94106c9df1bef42ab60ab7aa2 /include | |
parent | 60bc2d20c40e37e92e4e15479ac4dccbde069bec (diff) | |
download | libgit2-45d387ac78bcf3167d69b736d0b322717bc492d4.tar.gz |
refs: Error handling rework. WIP
Diffstat (limited to 'include')
-rw-r--r-- | include/git2/errors.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/git2/errors.h b/include/git2/errors.h index 54da869b4..e3f5f4cb0 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -122,9 +122,12 @@ typedef struct { typedef enum { GITERR_NOMEMORY, + GITERR_REFERENCE, } git_error_class; +#define GITERR_CHECK_ALLOC(ptr, error) if (ptr == NULL) { giterr_set_oom(error); return -1 } + 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); |