From dda708e78f3c3f43d814d46c29ab9f2b9d47ed5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicent=20Mart=C3=AD?= Date: Fri, 9 Mar 2012 19:55:50 +0100 Subject: error-handling: On-disk config file backend Includes: - Proper error reporting when encountering syntax errors in a config file (file, line number, column). - Rewritten `config_write`, now with 99% less goto-spaghetti - Error state in `git_filebuf`: filebuf write functions no longer need to be checked for error returns. If any of the writes performed on a buffer fail, the last call to `git_filebuf_commit` or `git_filebuf_hash` will fail accordingly and set the appropiate error message. Baller! --- include/git2/errors.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'include/git2/errors.h') diff --git a/include/git2/errors.h b/include/git2/errors.h index bc420d1d4..085dd52f0 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -127,14 +127,9 @@ typedef enum { GITERR_ZLIB, GITERR_REPOSITORY, GITERR_CONFIG, + GITERR_REGEX, } git_error_class; -#define GITERR_CHECK_ALLOC(ptr) if (ptr == NULL) { return -1; } - -GIT_EXTERN(void) giterr_set_oom(void); -GIT_EXTERN(void) giterr_set(int error_class, const char *string, ...); -GIT_EXTERN(void) giterr_clear(void); - /** * Return a detailed error string with the latest error * that occurred in the library. -- cgit v1.2.1