mirror of
https://github.com/openharmony/developtools_global_resource_tool.git
synced 2026-07-20 22:47:00 -04:00
+134
-224
@@ -21,11 +21,15 @@ namespace OHOS {
|
||||
namespace Global {
|
||||
namespace Restool {
|
||||
const std::map<uint32_t, ErrorInfo> ERRORS_MAP = {
|
||||
// 11200000
|
||||
{ ERR_CODE_UNDEFINED_ERROR,
|
||||
{ ERR_CODE_UNDEFINED_ERROR, "Undefined Error", "Unknown error: %s", "", { "Please try again." }, {} } },
|
||||
|
||||
// 11201xxx
|
||||
{ ERR_CODE_LOAD_LIBRARY_FAIL,
|
||||
{ ERR_CODE_LOAD_LIBRARY_FAIL,
|
||||
ERR_TYPE_DEPENDENCY,
|
||||
"Load library failed, path: '%s', %s",
|
||||
"Failed to load the library '%s', %s",
|
||||
"",
|
||||
{ "Make sure the library path is correct and has access permissions." },
|
||||
{} } },
|
||||
@@ -34,14 +38,14 @@ const std::map<uint32_t, ErrorInfo> ERRORS_MAP = {
|
||||
{ ERR_CODE_OPEN_JSON_FAIL,
|
||||
{ ERR_CODE_OPEN_JSON_FAIL,
|
||||
ERR_TYPE_CONFIG,
|
||||
"Open json file '%s' failed, %s.",
|
||||
"Failed to open the JSON file '%s', %s.",
|
||||
"",
|
||||
{ "Make sure the json file path is correct and has access permissions." },
|
||||
{ "Make sure the JSON file path is correct and has access permissions." },
|
||||
{} } },
|
||||
{ ERR_CODE_JSON_FORMAT_ERROR,
|
||||
{ ERR_CODE_JSON_FORMAT_ERROR,
|
||||
ERR_TYPE_CONFIG,
|
||||
"Parse json file failed, please check the file.",
|
||||
"Failed to parse the JSON file, format is incorrect.",
|
||||
"",
|
||||
{ "Check the JSON file and delete unnecessary commas (,).",
|
||||
"Check the JSON file to make sure the root bracket is {}." },
|
||||
@@ -49,7 +53,7 @@ const std::map<uint32_t, ErrorInfo> ERRORS_MAP = {
|
||||
{ ERR_CODE_JSON_NODE_MISMATCH,
|
||||
{ ERR_CODE_JSON_NODE_MISMATCH,
|
||||
ERR_TYPE_CONFIG,
|
||||
"Parse json file failed, the '%s' node type mismatch, expected type: '%s'.",
|
||||
"The value type of node '%s' does not match, expected type: %s.",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
@@ -60,261 +64,247 @@ const std::map<uint32_t, ErrorInfo> ERRORS_MAP = {
|
||||
{ ERR_CODE_JSON_NOT_ONE_MEMBER,
|
||||
{ ERR_CODE_JSON_NOT_ONE_MEMBER,
|
||||
ERR_TYPE_CONFIG,
|
||||
"The node '%s' of the json file can only have one member.",
|
||||
"The node '%s' of the JSON file can only have one member.",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
{ ERR_CODE_JSON_INVALID_NODE_NAME,
|
||||
{ ERR_CODE_JSON_INVALID_NODE_NAME, ERR_TYPE_CONFIG, "Invalid node name '%s'.", "", {}, {} } },
|
||||
{ ERR_CODE_JSON_INVALID_NODE_NAME,
|
||||
ERR_TYPE_CONFIG,
|
||||
"Invalid node name '%s', it should be one of %s.",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
|
||||
// 11204xxx
|
||||
{ ERR_CODE_CREATE_FILE_ERROR,
|
||||
{ ERR_CODE_CREATE_FILE_ERROR,
|
||||
ERR_TYPE_FILE_RESOURCE,
|
||||
"Create directory or file '%s' failed, %s.",
|
||||
"Failed to create directory or file '%s', %s.",
|
||||
"",
|
||||
{ "Make sure the file path is correct and has access permissions." },
|
||||
{} } },
|
||||
{ ERR_CODE_FILE_NOT_EXIST,
|
||||
{ ERR_CODE_FILE_NOT_EXIST,
|
||||
ERR_TYPE_FILE_RESOURCE,
|
||||
"File not exists, '%s'.",
|
||||
"",
|
||||
{ "Make sure the file path is correct." },
|
||||
{} } },
|
||||
{ ERR_CODE_REMOVE_FILE_ERROR,
|
||||
{ ERR_CODE_REMOVE_FILE_ERROR,
|
||||
ERR_TYPE_FILE_RESOURCE,
|
||||
"Remove dir/file '%s' failed, %s.",
|
||||
"Failed to delete directory or file '%s', %s.",
|
||||
"",
|
||||
{ "Make sure the file path is correct." },
|
||||
{ "Make sure the file path is correct and has access permissions." },
|
||||
{} } },
|
||||
{ ERR_CODE_COPY_FILE_ERROR,
|
||||
{ ERR_CODE_COPY_FILE_ERROR,
|
||||
ERR_TYPE_FILE_RESOURCE,
|
||||
"Copy file from '%s' to '%s' failed, %s.",
|
||||
"Failed to copy file from '%s' to '%s', %s.",
|
||||
"",
|
||||
{ "Make sure the src and dest file path is correct and has access permissions." },
|
||||
{} } },
|
||||
{ ERR_CODE_OPEN_FILE_ERROR,
|
||||
{ ERR_CODE_OPEN_FILE_ERROR,
|
||||
ERR_TYPE_FILE_RESOURCE,
|
||||
"Open file failed '%s', %s.",
|
||||
"Failed to open file '%s', %s.",
|
||||
"",
|
||||
{ "Make sure the src and dest file path is correct and has access permissions." },
|
||||
{ "Make sure the file path is correct and has access permissions." },
|
||||
{} } },
|
||||
{ ERR_CODE_FILE_EMPTY, { ERR_CODE_FILE_EMPTY, ERR_TYPE_FILE_RESOURCE, "File is empty '%s'.", "", {}, {} } },
|
||||
{ ERR_CODE_FILE_STREAM_ERROR,
|
||||
{ ERR_CODE_FILE_STREAM_ERROR, ERR_TYPE_FILE_RESOURCE, "File stream bad, state code: %d.", "", {}, {} } },
|
||||
{ ERR_CODE_FILE_MAP_ERROR,
|
||||
{ ERR_CODE_FILE_MAP_ERROR, ERR_TYPE_FILE_RESOURCE, "File mapping failed, %s.", "", {}, {} } },
|
||||
|
||||
// 11205xxx
|
||||
{ ERR_CODE_SET_DATA_ERROR,
|
||||
{ ERR_CODE_SET_DATA_ERROR,
|
||||
ERR_TYPE_SYNTAX,
|
||||
"Set resource item data of '%s' failed, it may be due to insufficient memory.",
|
||||
{ ERR_CODE_READ_FILE_ERROR,
|
||||
{ ERR_CODE_READ_FILE_ERROR,
|
||||
ERR_TYPE_FILE_RESOURCE,
|
||||
"Failed to read file '%s', %s.",
|
||||
"",
|
||||
{ "Retry compile." },
|
||||
{} } },
|
||||
{ ERR_CODE_ITEM_DATA_NULL,
|
||||
{ ERR_CODE_ITEM_DATA_NULL,
|
||||
ERR_TYPE_SYNTAX,
|
||||
"Get resource item data of '%s' failed, null.",
|
||||
"",
|
||||
{ "Retry compile." },
|
||||
{} } },
|
||||
{ ERR_CODE_MEMCPY_ERROR,
|
||||
{ ERR_CODE_MEMCPY_ERROR, ERR_TYPE_SYNTAX, "Memory copy failed in '%s'.", "", { "Retry compile." }, {} } },
|
||||
{ ERR_CODE_CREATE_JSON_ERROR,
|
||||
{ ERR_CODE_CREATE_JSON_ERROR,
|
||||
ERR_TYPE_SYNTAX,
|
||||
"Generate JSON failed, %s.",
|
||||
"",
|
||||
{ "Run the command again." },
|
||||
{ "Make sure the file content is correct." },
|
||||
{} } },
|
||||
|
||||
// 11210xxx
|
||||
{ ERR_CODE_UNKNOWN_COMMAND_ERROR,
|
||||
{ ERR_CODE_UNKNOWN_COMMAND_ERROR,
|
||||
ERR_TYPE_COMMAND_PARSE,
|
||||
"Unknown error: %s",
|
||||
"Unknown command error: %s",
|
||||
"",
|
||||
{ "For details, see the help with option -h/--help." },
|
||||
{} } },
|
||||
{ ERR_CODE_UNKNOWN_OPTION,
|
||||
{ ERR_CODE_UNKNOWN_OPTION,
|
||||
ERR_TYPE_COMMAND_PARSE,
|
||||
"Unknown option: '%s'",
|
||||
"Unknown option '%s'.",
|
||||
"",
|
||||
{ "For details, see the help with option -h/--help." },
|
||||
{} } },
|
||||
{ ERR_CODE_MISSING_ARGUMENT,
|
||||
{ ERR_CODE_MISSING_ARGUMENT,
|
||||
ERR_TYPE_COMMAND_PARSE,
|
||||
"Option '%s' must have argument",
|
||||
"Option '%s' should have a argument.",
|
||||
"",
|
||||
{ "For details, see the help with option -h/--help." },
|
||||
{} } },
|
||||
{ ERR_CODE_INVALID_ARGUMENT,
|
||||
{ ERR_CODE_INVALID_ARGUMENT,
|
||||
ERR_TYPE_COMMAND_PARSE,
|
||||
"Invalid arguments : '%s'",
|
||||
"Invalid argument value '%s'.",
|
||||
"",
|
||||
{ "For details, see the help with option -h/--help." },
|
||||
{} } },
|
||||
{ ERR_CODE_INVALID_INPUT,
|
||||
{ ERR_CODE_INVALID_INPUT,
|
||||
ERR_TYPE_COMMAND_PARSE,
|
||||
"Invalid input '%s'",
|
||||
"Invalid input path '%s'.",
|
||||
"",
|
||||
{ "Make sure the input path of option -i/--inputPath is correct." },
|
||||
{} } },
|
||||
{ ERR_CODE_DUPLICATE_INPUT,
|
||||
{ ERR_CODE_DUPLICATE_INPUT,
|
||||
ERR_TYPE_COMMAND_PARSE,
|
||||
"Duplicated input '%s'",
|
||||
"Duplicated input path '%s'.",
|
||||
"",
|
||||
{ "Make sure the input path of option -i/--inputPath is unique." },
|
||||
{} } },
|
||||
{ ERR_CODE_DOUBLE_PACKAGE_NAME,
|
||||
{ ERR_CODE_DOUBLE_PACKAGE_NAME,
|
||||
ERR_TYPE_COMMAND_PARSE,
|
||||
"Double package name '%s' vs '%s'",
|
||||
"The package name '%s' and '%s' conflict.",
|
||||
"",
|
||||
{ "Make sure the option -p/--packageName only specified once." },
|
||||
{} } },
|
||||
{ ERR_CODE_INVALID_OUTPUT,
|
||||
{ ERR_CODE_INVALID_OUTPUT,
|
||||
ERR_TYPE_COMMAND_PARSE,
|
||||
"Invalid output '%s'",
|
||||
"Invalid output path '%s'.",
|
||||
"",
|
||||
{ "Make sure the output path of option -o/--outputPath is correct." },
|
||||
{} } },
|
||||
{ ERR_CODE_DOUBLE_OUTPUT,
|
||||
{ ERR_CODE_DOUBLE_OUTPUT,
|
||||
ERR_TYPE_COMMAND_PARSE,
|
||||
"Double output '%s' vs '%s'",
|
||||
"The output path '%s' and '%s' conflict.",
|
||||
"",
|
||||
{ "Make sure the option -o/--outputPath only specified once." },
|
||||
{} } },
|
||||
{ ERR_CODE_DUPLICATE_RES_HEADER,
|
||||
{ ERR_CODE_DUPLICATE_RES_HEADER,
|
||||
ERR_TYPE_COMMAND_PARSE,
|
||||
"Duplicated res header path '%s'",
|
||||
"Duplicated res header path '%s'.",
|
||||
"",
|
||||
{ "Make sure the path of option -r/--resHeader is unique." },
|
||||
{} } },
|
||||
{ ERR_CODE_DOUBLE_MODULES,
|
||||
{ ERR_CODE_DOUBLE_MODULES,
|
||||
ERR_TYPE_COMMAND_PARSE,
|
||||
"Double module name '%s'",
|
||||
"The module name '%s' and '%s' conflict.",
|
||||
"",
|
||||
{ "Make sure the option -m/--modules only specified once." },
|
||||
{} } },
|
||||
{ ERR_CODE_DUPLICATE_MODULE_NAME,
|
||||
{ ERR_CODE_DUPLICATE_MODULE_NAME,
|
||||
ERR_TYPE_COMMAND_PARSE,
|
||||
"Duplicated module name '%s'",
|
||||
"Duplicated module name '%s'.",
|
||||
"",
|
||||
{ "Make sure the module name is unique." },
|
||||
{ "Make sure the module names specified with option -m/--modules is unique." },
|
||||
{} } },
|
||||
{ ERR_CODE_DOUBLE_CONFIG_JSON,
|
||||
{ ERR_CODE_DOUBLE_CONFIG_JSON,
|
||||
ERR_TYPE_COMMAND_PARSE,
|
||||
"Double config json '%s' vs '%s'",
|
||||
"The module.json(in Stage Model) or config.json(in FA Model) path '%s' and '%s' conflict.",
|
||||
"",
|
||||
{ "Make sure the option -j/--json only specified once." },
|
||||
{} } },
|
||||
{ ERR_CODE_INVALID_START_ID,
|
||||
{ ERR_CODE_INVALID_START_ID,
|
||||
ERR_TYPE_COMMAND_PARSE,
|
||||
"Invalid start id '%s'",
|
||||
"Invalid start id '%s', out of range.",
|
||||
"",
|
||||
{ "Make sure the start id in the scope [0x01000000, 0x06FFFFFF) or [0x08000000, 0xFFFFFFFF)" },
|
||||
{ "Make sure the start id in the scope [0x01000000, 0x06FFFFFF) or [0x08000000, 0xFFFFFFFF)." },
|
||||
{} } },
|
||||
{ ERR_CODE_DUPLICATE_APPEND_PATH,
|
||||
{ ERR_CODE_DUPLICATE_APPEND_PATH,
|
||||
ERR_TYPE_COMMAND_PARSE,
|
||||
"Duplicated input append path '%s'",
|
||||
"Duplicated append path '%s'.",
|
||||
"",
|
||||
{ "Make sure the path of option -x/--append is unique." },
|
||||
{} } },
|
||||
{ ERR_CODE_DOUBLE_TARGET_CONFIG,
|
||||
{ ERR_CODE_DOUBLE_TARGET_CONFIG,
|
||||
ERR_TYPE_COMMAND_PARSE,
|
||||
"Double option '--target-config'",
|
||||
"The target config '%s' and '%s' conflict.",
|
||||
"",
|
||||
{ "Make sure the option --target-config only specified once." },
|
||||
{} } },
|
||||
{ ERR_CODE_INVALID_TARGET_CONFIG,
|
||||
{ ERR_CODE_INVALID_TARGET_CONFIG,
|
||||
ERR_TYPE_COMMAND_PARSE,
|
||||
"Invalid target config argument '%s'",
|
||||
"Invalid target config argument '%s'.The argument format of option --target-config is supposed to be like "
|
||||
"'Locale[zh_CN,en_US];Device[phone]'.",
|
||||
"",
|
||||
{ "The argument format of option --target-config is supposed to be like 'Locale[zh_CN,en_US];Device[phone]', "
|
||||
"for details, see the developer documentation." },
|
||||
{ "For more information, see the developer documentation." },
|
||||
{} } },
|
||||
{ ERR_CODE_INVALID_SYSTEM_ID_DEFINED,
|
||||
{ ERR_CODE_INVALID_SYSTEM_ID_DEFINED,
|
||||
ERR_TYPE_COMMAND_PARSE,
|
||||
"Invalid system id_defined.json path '%s'",
|
||||
"Invalid system id_defined.json path '%s'.",
|
||||
"",
|
||||
{ "Make sure the system id_defined.json path is correct." },
|
||||
{} } },
|
||||
{ ERR_CODE_DUPLICATE_SYSTEM_ID_DEFINED,
|
||||
{ ERR_CODE_DUPLICATE_SYSTEM_ID_DEFINED,
|
||||
ERR_TYPE_COMMAND_PARSE,
|
||||
"Duplicated system id_defined.json path '%s'",
|
||||
"Duplicated system id_defined.json path '%s'.",
|
||||
"",
|
||||
{ "Make sure the system id_defined.json path is unique." },
|
||||
{} } },
|
||||
{ ERR_CODE_DOUBLE_COMPRESSION_PATH,
|
||||
{ ERR_CODE_DOUBLE_COMPRESSION_PATH,
|
||||
ERR_TYPE_COMMAND_PARSE,
|
||||
"Double compression json path '%s' vs '%s'",
|
||||
"The compression JSON path '%s' and '%s' conflict.",
|
||||
"",
|
||||
{ "Make sure the option --compressed-config only specified once." },
|
||||
{} } },
|
||||
{ ERR_CODE_NON_ASCII,
|
||||
{ ERR_CODE_NON_ASCII,
|
||||
ERR_TYPE_COMMAND_PARSE,
|
||||
"'%s' must be ASCII",
|
||||
"The argument value '%s' is not an ASCII value.",
|
||||
"",
|
||||
{ "Make sure all the argument's characters is ASCII." },
|
||||
{ "Make sure all the arguments value characters is ASCII." },
|
||||
{} } },
|
||||
{ ERR_CODE_EXCLUSIVE_OPTION,
|
||||
{ ERR_CODE_EXCLUSIVE_OPTION, ERR_TYPE_COMMAND_PARSE, "Option %s and %s cannot be used together.", "", {}, {} } },
|
||||
{ ERR_CODE_EXCLUSIVE_OPTION,
|
||||
ERR_TYPE_COMMAND_PARSE,
|
||||
"Option '%s' and '%s' cannot be used together.",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
{ ERR_CODE_PACKAGE_NAME_EMPTY,
|
||||
{ ERR_CODE_PACKAGE_NAME_EMPTY,
|
||||
ERR_TYPE_COMMAND_PARSE,
|
||||
"Package name empty.",
|
||||
"The package name is empty, it should be specified with option -p/--packageName",
|
||||
"",
|
||||
{ "Specifies the package name with option -p/--packageName." },
|
||||
{} } },
|
||||
{ ERR_CODE_RES_HEADER_PATH_EMPTY,
|
||||
{ ERR_CODE_RES_HEADER_PATH_EMPTY,
|
||||
ERR_TYPE_COMMAND_PARSE,
|
||||
"Resource header path empty.",
|
||||
"The resource header path(like ./ResourceTable.js, ./ResrouceTable.h) is empty, it should be specified with "
|
||||
"option -r/--resHeader.",
|
||||
"",
|
||||
{ "Specifies header path with option -r/--resHeader." },
|
||||
{} } },
|
||||
{ ERR_CODE_DUMP_MISSING_INPUT,
|
||||
{ ERR_CODE_DUMP_MISSING_INPUT,
|
||||
ERR_TYPE_COMMAND_PARSE,
|
||||
"Resource dump missing input path.",
|
||||
"The HAP path of the resource dump command is missing.",
|
||||
"",
|
||||
{ "Specifies input path after dump command." },
|
||||
{ "Specifies a HAP path with dump command." },
|
||||
{} } },
|
||||
{ ERR_CODE_DUMP_INVALID_INPUT,
|
||||
{ ERR_CODE_DUMP_INVALID_INPUT,
|
||||
ERR_TYPE_COMMAND_PARSE,
|
||||
"Resource dump invalid input path.",
|
||||
"Invalid HAP path '%s' of the resource dump command.",
|
||||
"",
|
||||
{ "Make sure the input path after dump command is correct." },
|
||||
{ "Make sure the HAP path of dump command is correct." },
|
||||
{} } },
|
||||
{ ERR_CODE_INVALID_THREAD_COUNT,
|
||||
{ ERR_CODE_INVALID_THREAD_COUNT, ERR_TYPE_COMMAND_PARSE, "Invalid thread count: %s.", "", {}, {} } },
|
||||
{ ERR_CODE_INVALID_THREAD_COUNT,
|
||||
ERR_TYPE_COMMAND_PARSE,
|
||||
"Invalid thread count '%s', it should be an integer and greater than 0.",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
|
||||
// 11211xxx
|
||||
{ ERR_CODE_OUTPUT_EXIST,
|
||||
@@ -327,281 +317,201 @@ const std::map<uint32_t, ErrorInfo> ERRORS_MAP = {
|
||||
{ ERR_CODE_CONFIG_JSON_MISSING,
|
||||
{ ERR_CODE_CONFIG_JSON_MISSING,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"More input path, but -j config.json not specified.",
|
||||
"Multiple input paths, but the module.json(in Stage Model) or config.json(in FA Model) path is not specified "
|
||||
"with option -j/--json.",
|
||||
"",
|
||||
{ "Specifies the config.json with option -j/--json." },
|
||||
{ "Specifies option -j/--json." },
|
||||
{} } },
|
||||
{ ERR_CODE_INVALID_MODULE_TYPE,
|
||||
{ ERR_CODE_INVALID_MODULE_TYPE,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"Invalid module type '%s', expected type is one of [entry, har, shared, feature].",
|
||||
"Invalid module type '%s', it should be one of [\"entry\", \"har\", \"shared\", \"feature\"].",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
{ ERR_CODE_EXCLUSIVE_START_ID,
|
||||
{ ERR_CODE_EXCLUSIVE_START_ID,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"The set start_id and id_defined.json cannot be used together.",
|
||||
"The id_defined.json and the start id '%lu' specified with option -e/--startId conflict.",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
{ ERR_CODE_ID_DEFINED_NODE_MISSING,
|
||||
{ ERR_CODE_ID_DEFINED_NODE_MISSING,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"The id_defined.json seq = %lu %s empty.",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
{ ERR_CODE_ID_DEFINED_NODE_MISMATCH,
|
||||
{ ERR_CODE_ID_DEFINED_NODE_MISMATCH,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"The id_defined.json seq = %lu %s not %s.",
|
||||
"",
|
||||
{},
|
||||
{ "Retain only one of the id_defined.json and the start id." },
|
||||
{} } },
|
||||
{ ERR_CODE_ID_DEFINED_INVALID_TYPE,
|
||||
{ ERR_CODE_ID_DEFINED_INVALID_TYPE,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"The id_defined.json seq = %lu type '%s' invalid.",
|
||||
"Invalid resource type '%s' in the id_defined.json, it should be one of %s.",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
{ ERR_CODE_ID_DEFINED_INVALID_ID,
|
||||
{ ERR_CODE_ID_DEFINED_INVALID_ID,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"The id_defined.json seq = %lu id must be a hex string, eg:^0[xX][0-9a-fA-F]{8}.",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
{ ERR_CODE_ID_DEFINED_ID_OUT_RANGE,
|
||||
{ ERR_CODE_ID_DEFINED_ID_OUT_RANGE,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"The id_defined.json seq = %lu id must in [0x01000000,0x06FFFFFF],[0x08000000,0xFFFFFFFF].",
|
||||
"Invalid id value '%s' in the id_defined.json, it shoud be a hex string, match the pattern "
|
||||
"^0[xX][0-9a-fA-F]{8}, and in the scope [0x01000000,0x06FFFFFF] or [0x08000000,0xFFFFFFFF].",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
{ ERR_CODE_ID_DEFINED_ORDER_MISMATCH,
|
||||
{ ERR_CODE_ID_DEFINED_ORDER_MISMATCH,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"The id_defined.json seq = %lu order value %lu vs expect %lu.",
|
||||
"The order value '%lu' in the id_defined.json does not match the record element sequence '%lu', "
|
||||
"expected value: %lu.",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
{ ERR_CODE_ID_DEFINED_INVALID_START_ID,
|
||||
{ ERR_CODE_ID_DEFINED_INVALID_START_ID,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"The id_defined.json 'startId' is invalid.",
|
||||
"",
|
||||
{},
|
||||
{ "Make sure the order value is same as the sequence." },
|
||||
{} } },
|
||||
{ ERR_CODE_ID_DEFINED_SAME_ID,
|
||||
{ ERR_CODE_ID_DEFINED_SAME_ID,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"The id_defined.json '%s' and '%s' defind the same ID.",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
{ ERR_CODE_ID_DEFINED_SAME_RESOURCE,
|
||||
{ ERR_CODE_ID_DEFINED_SAME_RESOURCE,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"The same resource of '%s' exists in the %s",
|
||||
"The name '%s' and '%s' in the id_defined.json define the same ID.",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
{ ERR_CODE_MODULE_NAME_NOT_FOUND,
|
||||
{ ERR_CODE_MODULE_NAME_NOT_FOUND,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"The module name '%s' in config.json not found in [%s] which specifies with -m/--modules.",
|
||||
"The module name '%s' not found in %s, which specifies with -m/--modules.",
|
||||
"",
|
||||
{ "Make sure the module name in config.json is correct." },
|
||||
{ "Make sure the module name in module.json(in Stage Model) or config.json(in FA Model) is correct." },
|
||||
{} } },
|
||||
{ ERR_CODE_RESOURCE_PATH_NOT_DIR,
|
||||
{ ERR_CODE_RESOURCE_PATH_NOT_DIR,
|
||||
{ ERR_CODE_INVALID_RESOURCE_PATH,
|
||||
{ ERR_CODE_INVALID_RESOURCE_PATH,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"Scan resource failed, the path '%s' is not directory.",
|
||||
"Failed to scan resources, invalid path '%s', %s.",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
{ ERR_CODE_INVALID_FILE_PATH,
|
||||
{ ERR_CODE_INVALID_FILE_PATH,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"Invalid file path '%s'.",
|
||||
"",
|
||||
{ "Make sure the path is correct." },
|
||||
{} } },
|
||||
{ ERR_CODE_INVALID_LIMIT_KEY,
|
||||
{ ERR_CODE_INVALID_LIMIT_KEY, ERR_TYPE_RESOURCE_PACK, "Invalid limit key '%s'.", "", {}, {} } },
|
||||
{ ERR_CODE_INVALID_LIMIT_KEY,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"Invalid qualifiers key '%s', it should match the pattern of qualifiers directory,for example zh_CN,en_US,etc.",
|
||||
"",
|
||||
{ "For more information, see the developer documentation." },
|
||||
{} } },
|
||||
{ ERR_CODE_INVALID_RESOURCE_DIR,
|
||||
{ ERR_CODE_INVALID_RESOURCE_DIR,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"Invalid resource directory name '%s', must in [%s].",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
{ ERR_CODE_RESOURCE_PATH_NOT_FILE,
|
||||
{ ERR_CODE_RESOURCE_PATH_NOT_FILE,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"Scan resource failed, the resource '%s' must be a file.",
|
||||
"Invalid resource directory name '%s', it should be one of %s.",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
{ ERR_CODE_INVALID_TRANSLATE_PRIORITY,
|
||||
{ ERR_CODE_INVALID_TRANSLATE_PRIORITY,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"Invalid translate priority value '%s', must in [%s].",
|
||||
"Invalid translate priority value '%s', it should be one of %s.",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
{ ERR_CODE_INVALID_ELEMENT_TYPE,
|
||||
{ ERR_CODE_INVALID_ELEMENT_TYPE, ERR_TYPE_RESOURCE_PACK, "Unsupport element resource type '%s'.", "", {}, {} } },
|
||||
{ ERR_CODE_INVALID_ELEMENT_TYPE,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"Unsupported element resource type '%s', it should be one of %s.",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
{ ERR_CODE_INVALID_COLOR_VALUE,
|
||||
{ ERR_CODE_INVALID_COLOR_VALUE,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"Invalid color value '%s', only support refer '$color:xxx' or '#rgb','#argb','#rrggbb','#aarrggbb'.",
|
||||
"Invalid color value '%s' of the resource '%s', it only supported reference '$color:xxx' or '#rgb','#argb',"
|
||||
"'#rrggbb','#aarrggbb'.",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
{ ERR_CODE_INVALID_RESOURCE_REF,
|
||||
{ ERR_CODE_INVALID_RESOURCE_REF,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"Invalid resource reference '%s', only support refer '%sxxx'.",
|
||||
"Invalid resource reference '%s', it only supported reference '%sxxx'.",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
{ ERR_CODE_PARENT_EMPTY,
|
||||
{ ERR_CODE_PARENT_EMPTY,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"The resource's parent is emptry, type: '%s', name: '%s'.",
|
||||
"The parent value of resource '%s' is empty, it should be a valid resource name.",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
{ ERR_CODE_ARRAY_TOO_LARGE,
|
||||
{ ERR_CODE_ARRAY_TOO_LARGE, ERR_TYPE_RESOURCE_PACK, "The array resource '%s' is to large.", "", {}, {} } },
|
||||
{ ERR_CODE_ARRAY_TOO_LARGE,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"The array resource '%s' is to large, the total length of the value of the array elements cannot exceed 65535.",
|
||||
"",
|
||||
{ "Separate the large array into multiple arrays." },
|
||||
{} } },
|
||||
{ ERR_CODE_INVALID_QUANTITY,
|
||||
{ ERR_CODE_INVALID_QUANTITY,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"Invalid quantity resource, name: '%s', quantity: '%s', the quantity must be one of [%s].",
|
||||
"Invalid quantity '%s' of the resource '%s', it should be one of %s.",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
{ ERR_CODE_DUPLICATE_QUANTITY,
|
||||
{ ERR_CODE_DUPLICATE_QUANTITY,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"Duplicated quantity resource, name: '%s', quantity: '%s'.",
|
||||
"Duplicated quantity '%s' of the plural resource '%s'.",
|
||||
"",
|
||||
{},
|
||||
{ "Make sure the quantity of the plural resource is unique." },
|
||||
{} } },
|
||||
{ ERR_CODE_QUANTITY_NO_OTHER,
|
||||
{ ERR_CODE_QUANTITY_NO_OTHER,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"The quantity resource '%s' must contains 'other' quantity.",
|
||||
"The plural resource '%s' should contains 'other' quantity.",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
{ ERR_CODE_INVALID_SYMBOL,
|
||||
{ ERR_CODE_INVALID_SYMBOL,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"The symbol resource '%s' invalid, value must in 0xF0000 ~ 0xFFFFF or 0x100000 ~ 0x10FFFF.",
|
||||
"Invalid value '%d' of the symbol resource '%s', it should be in the scope [0xF0000,0xFFFFF] or "
|
||||
"[0x100000,0x10FFFF].",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
{ ERR_CODE_INVALID_RESOURCE_NAME,
|
||||
{ ERR_CODE_INVALID_RESOURCE_NAME,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"Invalid resource name '%s', the name can only contain [a-zA-Z0-9_].",
|
||||
"Invalid resource name '%s', it should be match the pattern [a-zA-Z0-9_].",
|
||||
"",
|
||||
{ "Modify the name to match [a-zA-Z0-9_]." },
|
||||
{ "Modify the name to match the pattern [a-zA-Z0-9_]." },
|
||||
{} } },
|
||||
{ ERR_CODE_RESOURCE_DUPLICATE,
|
||||
{ ERR_CODE_RESOURCE_DUPLICATE,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"Resource '%s' conflict, first declared at %s, but declare again at %s.",
|
||||
"Resource '%s' conflict, first declared at '%s', but declare again at '%s'.",
|
||||
"",
|
||||
{ "Make sure the resource names of same type are unique." },
|
||||
{ "Make sure the resource name of the same type is unique." },
|
||||
{} } },
|
||||
{ ERR_CODE_RESOURCE_ID_EXCEED,
|
||||
{ ERR_CODE_RESOURCE_ID_EXCEED,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"The resource id %lu exceed, greater than the max id %lu",
|
||||
"The resource id '%lu' exceed, greater than the max id '%lu'.",
|
||||
"",
|
||||
{},
|
||||
{ "Delete useless resources and recompile.", "Specify a smaller start id." },
|
||||
{} } },
|
||||
{ ERR_CODE_RESOURCE_ID_NOT_DEFINED,
|
||||
{ ERR_CODE_RESOURCE_ID_NOT_DEFINED,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"The resource id not be defined, resource type: %s, name: '%s'.",
|
||||
"The id of resource '%s' of the '%s' type is not defined.",
|
||||
"",
|
||||
{},
|
||||
{ "Delete useless resources and recompile." },
|
||||
{} } },
|
||||
{ ERR_CODE_REF_NOT_DEFINED,
|
||||
{ ERR_CODE_REF_NOT_DEFINED,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"The resource reference '%s' don't be defined.",
|
||||
"The resource reference '%s' is not defined.",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
{ ERR_CODE_ARRAY_DECOMPOSE_ERROR,
|
||||
{ ERR_CODE_ARRAY_DECOMPOSE_ERROR,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"Decompose strings failed, name: '%s', data: '%s'.",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
{ ERR_CODE_ARRAY_COMPOSE_ERROR,
|
||||
{ ERR_CODE_ARRAY_COMPOSE_ERROR,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"Compose strings failed, name: '%s', content size: '%lu'.",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
{ ERR_CODE_FA_ENTRY_NO_ICON_LABEL,
|
||||
{ ERR_CODE_FA_ENTRY_NO_ICON_LABEL,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"Entry MainAbility must have 'icon' and 'label'.",
|
||||
"",
|
||||
{},
|
||||
{ "Check whether this resource is defined anywhere." },
|
||||
{} } },
|
||||
{ ERR_CODE_INVALID_RESOURCE_INDEX,
|
||||
{ ERR_CODE_INVALID_RESOURCE_INDEX, ERR_TYPE_RESOURCE_PACK, "Invalid resources.index %s.", "", {}, {} } },
|
||||
{ ERR_CODE_RESOURCE_INDEX_ID_NOT_FOUND,
|
||||
{ ERR_CODE_RESOURCE_INDEX_ID_NOT_FOUND,
|
||||
{ ERR_CODE_INVALID_RESOURCE_INDEX,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"Find resource items in resources.index failed, the id %lu not found.",
|
||||
"Failed to parse the resources.index file, %s.",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
{ ERR_CODE_RESOURCE_INDEX_ITEM_EMPTY,
|
||||
{ ERR_CODE_RESOURCE_INDEX_ITEM_EMPTY,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"Find resource items in resources.index failed, the items of id %lu is empty.",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
{ ERR_CODE_RESOURCE_INDEX_INVALID_RESTYPE,
|
||||
{ ERR_CODE_RESOURCE_INDEX_INVALID_RESTYPE,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"Find resource items in resources.index failed, invalid restype '%s', expected type '%s'.",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
{ ERR_CODE_SAVE_INDEX_ERROR,
|
||||
{ ERR_CODE_SAVE_INDEX_ERROR,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"Save resources to resources.index failed, %s.",
|
||||
"",
|
||||
{},
|
||||
{} } },
|
||||
{ ERR_CODE_CREATE_ID_DEFINED_ERROR,
|
||||
{ ERR_CODE_CREATE_ID_DEFINED_ERROR,
|
||||
ERR_TYPE_RESOURCE_PACK,
|
||||
"Create id defined json '%s' failed, %s.",
|
||||
"",
|
||||
{},
|
||||
{ "Verify that the format of the resource.index file is correct." },
|
||||
{} } },
|
||||
|
||||
// 11212xxx
|
||||
{ ERR_CODE_PARSE_HAP_ERROR,
|
||||
{ ERR_CODE_PARSE_HAP_ERROR, ERR_TYPE_RESOURCE_PACK, "Parse hap failed, %s.", "", {}, {} } },
|
||||
{ ERR_CODE_PARSE_HAP_ERROR, ERR_TYPE_RESOURCE_DUMP, "Failed to parse the hap, %s.", "", {}, {} } },
|
||||
};
|
||||
|
||||
ErrorInfo GetError(const uint32_t &errCode)
|
||||
|
||||
Reference in New Issue
Block a user