fix error codes

Signed-off-by: liduo <liduo29@huawei.com>
This commit is contained in:
liduo
2025-02-13 11:27:21 +08:00
parent 0be64aa962
commit 74e31082e5
27 changed files with 433 additions and 470 deletions
+3 -3
View File
@@ -76,15 +76,15 @@ bool GenericCompiler::PostMediaFile(const FileInfo &fileInfo, const std::string
auto index = output.find_last_of(SEPARATOR_FILE);
if (index == string::npos) {
PrintError(GetError(ERR_CODE_INVALID_FILE_PATH).FormatCause(output.c_str()));
PrintError(GetError(ERR_CODE_INVALID_RESOURCE_PATH).FormatCause(output.c_str(), "missing separator"));
return false;
}
string data = output.substr(index + 1);
data = moduleName_ + SEPARATOR + RESOURCES_DIR + SEPARATOR + \
fileInfo.limitKey + SEPARATOR + fileInfo.fileCluster + SEPARATOR + data;
if (!resourceItem.SetData(reinterpret_cast<const int8_t *>(data.c_str()), data.length())) {
PrintError(GetError(ERR_CODE_SET_DATA_ERROR).FormatCause(resourceItem.GetName().c_str())
.SetPosition(fileInfo.filePath));
std::string msg = "item data is null, resource name: " + resourceItem.GetName();
PrintError(GetError(ERR_CODE_UNDEFINED_ERROR).FormatCause(msg.c_str()).SetPosition(fileInfo.filePath));
return false;
}