已合并
Revert "Global and Error to std.core" #1050
ivan-tyulyandin创建于 7月6日
Revert "Global and Error to std.core" #1050
已合并
共 2 个文件变更+6-6
| @@ -18,7 +18,7 @@ | |||
| 18 | namespace OHOS { | 18 | namespace OHOS { |
| 19 | namespace IntelligentScene { | 19 | namespace IntelligentScene { |
| 20 | constexpr const char *BUSINESS_ERROR_CLASS = "@ohos.base.BusinessError"; | 20 | constexpr const char *BUSINESS_ERROR_CLASS = "@ohos.base.BusinessError"; |
| 21 | -constexpr const char *ERROR_CLASS_NAME = "std.core.Error"; | 21 | +constexpr const char *ERROR_CLASS_NAME = "escompat.Error"; |
| 22 | 22 | ||
| 23 | void ThrowError(ani_env *env, int32_t errCode) | 23 | void ThrowError(ani_env *env, int32_t errCode) |
| 24 | { | 24 | { |
| @@ -64,7 +64,7 @@ ani_object WrapError(ani_env *env, const std::string &msg) | |||
| 64 | return nullptr; | 64 | return nullptr; |
| 65 | } | 65 | } |
| 66 | ani_method method = nullptr; | 66 | ani_method method = nullptr; |
| 67 | - if ((status = env->Class_FindMethod(cls, "<ctor>", "C{std.core.String}C{std.core.ErrorOptions}:", &method)) != | 67 | + if ((status = env->Class_FindMethod(cls, "<ctor>", "C{std.core.String}C{escompat.ErrorOptions}:", &method)) != |
| 68 | ANI_OK) { | 68 | ANI_OK) { |
| 69 | INTELLIGENTSCENE_LOG_ERROR("Class_FindMethod failed %{public}d", status); | 69 | INTELLIGENTSCENE_LOG_ERROR("Class_FindMethod failed %{public}d", status); |
| 70 | return nullptr; | 70 | return nullptr; |
| @@ -90,7 +90,7 @@ ani_object CreateError(ani_env *env, ani_int code, const std::string &msg) | |||
| 90 | return nullptr; | 90 | return nullptr; |
| 91 | } | 91 | } |
| 92 | ani_method method = nullptr; | 92 | ani_method method = nullptr; |
| 93 | - if ((status = env->Class_FindMethod(cls, "<ctor>", "iC{std.core.Error}:", &method)) != ANI_OK) { | 93 | + if ((status = env->Class_FindMethod(cls, "<ctor>", "iC{escompat.Error}:", &method)) != ANI_OK) { |
| 94 | INTELLIGENTSCENE_LOG_ERROR("Class_FindMethod failed %{public}d", status); | 94 | INTELLIGENTSCENE_LOG_ERROR("Class_FindMethod failed %{public}d", status); |
| 95 | return nullptr; | 95 | return nullptr; |
| 96 | } | 96 | } |
| @@ -96,11 +96,11 @@ ani_object CreateError(ani_env *env, const std::string &msg) | |||
| 96 | return nullptr; | 96 | return nullptr; |
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | - if ((status = env->FindClass("std.core.Error", &cls)) != ANI_OK) { | 99 | + if ((status = env->FindClass("escompat.Error", &cls)) != ANI_OK) { |
| 100 | SETTING_LOG_ERROR("FindClass failed %{public}d", status); | 100 | SETTING_LOG_ERROR("FindClass failed %{public}d", status); |
| 101 | return nullptr; | 101 | return nullptr; |
| 102 | } | 102 | } |
| 103 | - if ((status = env->Class_FindMethod(cls, "<ctor>", "C{std.core.String}C{std.core.ErrorOptions}:", &method)) != | 103 | + if ((status = env->Class_FindMethod(cls, "<ctor>", "C{std.core.String}C{escompat.ErrorOptions}:", &method)) != |
| 104 | ANI_OK) { | 104 | ANI_OK) { |
| 105 | SETTING_LOG_ERROR("Class_FindMethod failed %{public}d", status); | 105 | SETTING_LOG_ERROR("Class_FindMethod failed %{public}d", status); |
| 106 | return nullptr; | 106 | return nullptr; |
| @@ -127,7 +127,7 @@ ani_object CreateBusinessError(ani_env *env, int code, const std::string &msg) | |||
| 127 | SETTING_LOG_ERROR("FindClass failed %{public}d", status); | 127 | SETTING_LOG_ERROR("FindClass failed %{public}d", status); |
| 128 | return nullptr; | 128 | return nullptr; |
| 129 | } | 129 | } |
| 130 | - if ((status = env->Class_FindMethod(cls, "<ctor>", "iC{std.core.Error}:", &method)) != ANI_OK) { | 130 | + if ((status = env->Class_FindMethod(cls, "<ctor>", "iC{escompat.Error}:", &method)) != ANI_OK) { |
| 131 | SETTING_LOG_ERROR("Class_FindMethod failed %{public}d", status); | 131 | SETTING_LOG_ERROR("Class_FindMethod failed %{public}d", status); |
| 132 | return nullptr; | 132 | return nullptr; |
| 133 | } | 133 | } |