diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2016-09-09 01:13:23 +0200 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2016-09-09 01:13:23 +0200 |
commit | e1db398049adf8ea37cebfc8f816be12f9ba131c (patch) | |
tree | ae6efacc5172caf211abe65510c105029ee2e09e /src/common/error.h | |
parent | d97662894bab06133830c2936986b7f1e57ae26f (diff) | |
download | blogc-e1db398049adf8ea37cebfc8f816be12f9ba131c.tar.gz blogc-e1db398049adf8ea37cebfc8f816be12f9ba131c.tar.bz2 blogc-e1db398049adf8ea37cebfc8f816be12f9ba131c.zip |
*: centralize error handling
Diffstat (limited to 'src/common/error.h')
-rw-r--r-- | src/common/error.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/common/error.h b/src/common/error.h index 17843ed..f2845df 100644 --- a/src/common/error.h +++ b/src/common/error.h @@ -11,9 +11,20 @@ #include <stddef.h> +// error handling is centralized here for the sake of simplicity :/ +typedef enum { + + // errors for src/blogc + BLOGC_ERROR_SOURCE_PARSER = 100, + BLOGC_ERROR_TEMPLATE_PARSER, + BLOGC_ERROR_LOADER, + BLOGC_ERROR_FILE, + BLOGC_WARNING_DATETIME_PARSER, +} bc_error_type_t; + typedef struct { char *msg; - int type; + bc_error_type_t type; } bc_error_t; bc_error_t* bc_error_new(int type, const char *msg); |