catch stoll error

Signed-off-by: woohoa <wanghuan36@huawei.com>
This commit is contained in:
15950533375 2024-11-13 17:12:24 +08:00 committed by zylworkhard1
parent f51ae2f2e4
commit 233d6cccf4

View File

@ -143,7 +143,13 @@ bool VerifyTask::HandleFailureClientError(std::string verifyTime, int verifyCnt)
APP_DOMAIN_VERIFY_HILOGD(APP_DOMAIN_VERIFY_MODULE_EXTENSION, "called");
if (!verifyTime.empty()) {
int64_t currTs = GetSecondsSince1970ToNow();
int64_t lastTs = static_cast<int64_t>(std::stoll(verifyTime));
int64_t lastTs{};
try {
lastTs = static_cast<int64_t>(std::stoll(verifyTime));
} catch (...) {
APP_DOMAIN_VERIFY_HILOGE(APP_DOMAIN_VERIFY_MODULE_EXTENSION, "get verifyTime error");
return false;
}
int64_t duration = currTs - lastTs;
int64_t currRetryDuration = CalcRetryDuration(verifyCnt);
if (duration <= currRetryDuration) {