Add concept of error messages.

pull/9/head
Joshua Potter 2023-11-25 06:47:49 -07:00
parent 9f38284e3d
commit 2501754886
1 changed files with 30 additions and 0 deletions

30
include/error.h Normal file
View File

@ -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 */