REFACTOR: Completely remade the error handling format. Using pre-defined

error codes and error messages to make it easier to debug problems.
This commit is contained in:
2026-09-03 14:14:41 -04:00
parent ff25fad5ae
commit 56d26fe723
8 changed files with 188 additions and 67 deletions
+16
View File
@@ -21,6 +21,22 @@
#define SHIFT_16 16 /**< Constant shift of 16-Bits */
#define SHIFT_24 24 /**< Constant shift of 24-Bits */
#define SUCCESS 0
#define FAILURE 1
#define ERR_BUF_NULL 20
#define ERR_FILE_NULL 21
#define ERR_INVALID_SIZE 22
#define ERR_CREATION_FAIL 23
#define ERR_IMG_NULL 24
#define ERR_IMG_NAME_INVALID 25
#define ERR_JHEADER 26
extern const char* error_messages[];
#define LOG(msg) printf("LOG: %s\n", msg)
#define LOGERROR(error_code) printf("ERROR: %s\n", error_messages[error_code])
/**
*
* @brief Max value for any channel