From 25017548867cd8bceff612e27f7efd6766572ab0 Mon Sep 17 00:00:00 2001 From: Joshua Potter Date: Sat, 25 Nov 2023 06:47:49 -0700 Subject: [PATCH] Add concept of error messages. --- include/error.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 include/error.h diff --git a/include/error.h b/include/error.h new file mode 100644 index 0000000..2b4fdac --- /dev/null +++ b/include/error.h @@ -0,0 +1,30 @@ +#ifndef _BOOTSTRAP_ERROR_H +#define _BOOTSTRAP_ERROR_H + +enum ErrorCode { + SUCCESS = 0, + + ERROR_CONFIG_ENV_CWD_INVALID, + ERROR_CONFIG_ENV_ROOT_DIR_INVALID, + ERROR_CONFIG_TARGET_NOT_FOUND, + ERROR_CONFIG_TARGET_NOT_DIR, + + ERROR_PARSER_SPEC_JSON_CANNOT_OPEN, + ERROR_PARSER_SPEC_JSON_INVALID_SYNTAX, + + ERROR_VALIDATOR_TOP_LEVEL_NOT_OBJECT, + ERROR_VALIDATOR_FIELD_NOT_OBJECT, + ERROR_VALIDATOR_FIELD_TYPE_INVALID, + ERROR_VALIDATOR_FIELD_TYPE_UNKNOWN, + ERROR_VALIDATOR_FIELD_PROMPT_INVALID, + + ERROR_EVALUATOR_RUN_SH_NOT_FOUND, + ERROR_EVALUATOR_RESPONSE_INVALID, +}; + +struct Error { + enum ErrorCode code; + const char *message; +}; + +#endif /* _BOOTSTRAP_ERROR_H */