diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2016-07-05 03:34:01 +0200 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2016-07-05 03:34:01 +0200 |
commit | 16c8bef25dc971c055526fb75a971cbc219822da (patch) | |
tree | 55bd09cc06b34a80fea04ab12ff1580814df7a59 /src/file.c | |
parent | 8fb67f6c89490e2bbce5d5650f930780e77b57c2 (diff) | |
download | blogc-16c8bef25dc971c055526fb75a971cbc219822da.tar.gz blogc-16c8bef25dc971c055526fb75a971cbc219822da.tar.bz2 blogc-16c8bef25dc971c055526fb75a971cbc219822da.zip |
file: added dedicated error type
Diffstat (limited to 'src/file.c')
-rw-r--r-- | src/file.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |