OP_LOGE_FOR_FILE_OPEN

Description

Records and reports a file opening failure error. If a file cannot be opened, an error log is generated and the error code EZ0030 is reported.

Prototype

OP_LOGE_FOR_FILE_OPEN(opName, filePath, reason)

Parameters

Parameter

Input/Output

Description

opName

Input

Operator name or aclnn API name. The type can be const char* or std::string.

filePath

Input

File path. The type can be const char* or std::string.

reason

Input

Opening failure cause. The type can be const char* or std::string.

Return Value

None.

Constraints

None.

Example

The following sample code is for reference only. Do not copy and run it.

1
2
3
4
5
std::ifstream ifs(filePath);
if (!ifs.is_open()) {
    OP_LOGE_FOR_FILE_OPEN("MyOp", filePath, "permission denied");
    return ge::GRAPH_FAILED;
}