ConvertString2Int()方法捕获未知错误

Signed-off-by: zhangdd_ewan <zhangdongdong50@huawei.com>
This commit is contained in:
zhangdd_ewan 2023-12-05 10:09:59 +08:00
parent a04bb9542f
commit f9595a6a80

View File

@ -65,6 +65,10 @@ int32_t ConvertString2Int(const string &numberStr, int32_t& status)
status = -1;
HiLog::Error(LABEL, "ConvertString2Int: invalid argument out of range");
return -1;
} catch (...) {
status = -1;
HiLog::Error(LABEL, "ConvertString2Int: undefined behavior.");
return -1;
}
}