diff --git a/interfaces/kits/js/backup/session_restore_n_exporter.cpp b/interfaces/kits/js/backup/session_restore_n_exporter.cpp index 0f3593067d484757ae18e93e28be0b3f2f9832ca..6fadfab5060d6f5b56f0d74566361678912f571a 100644 --- a/interfaces/kits/js/backup/session_restore_n_exporter.cpp +++ b/interfaces/kits/js/backup/session_restore_n_exporter.cpp @@ -70,6 +70,7 @@ static void OnFileReady(weak_ptr pCallbacks, const BFileInfo & static void onBundleBegin(weak_ptr pCallbacks, ErrCode err, const BundleName name) { + HILOGE("onBundleBegin"); if (pCallbacks.expired()) { HILOGI("callbacks is unbound"); return; @@ -84,7 +85,14 @@ static void onBundleBegin(weak_ptr pCallbacks, ErrCode err, co return; } + HILOGE("onBundleBegin %{public}d", err); auto cbCompl = [name {name}](napi_env env, NError err) -> NVal { + size_t bufLength = 0; + char *buffer = (char *)malloc((bufLength + 1) * sizeof(char)); + auto value = err.GetNapiErr(env); + napi_get_value_string_utf8(env, value, buffer, bufLength + 1, &bufLength); + HILOGE("GetNapiErr %{public}s", buffer); + free(buffer); return err ? NVal {env, err.GetNapiErr(env)} : NVal::CreateUTF8String(env, name); };