From 16c8bef25dc971c055526fb75a971cbc219822da Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Tue, 5 Jul 2016 03:34:01 +0200 Subject: file: added dedicated error type --- src/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/file.c') diff --git a/src/file.c b/src/file.c index 6da94a2..547f2f7 100644 --- a/src/file.c +++ b/src/file.c @@ -34,7 +34,7 @@ blogc_file_get_contents(const char *path, size_t *len, blogc_error_t **err) if (fp == NULL) { int tmp_errno = errno; - *err = blogc_error_new_printf(BLOGC_ERROR_LOADER, + *err = blogc_error_new_printf(BLOGC_ERROR_FILE, "Failed to open file (%s): %s", path, strerror(tmp_errno)); return NULL; } @@ -62,7 +62,7 @@ blogc_file_get_contents(const char *path, size_t *len, blogc_error_t **err) fclose(fp); if (!blogc_utf8_validate_str(str)) { - *err = blogc_error_new_printf(BLOGC_ERROR_LOADER, + *err = blogc_error_new_printf(BLOGC_ERROR_FILE, "File content is not valid UTF-8: %s", path); sb_string_free(str, true); return NULL; -- cgit v1.2.3-18-g5258