11401458bSopenharmony_ci/* 21401458bSopenharmony_ci * Copyright (c) 2021 Huawei Device Co., Ltd. 31401458bSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 41401458bSopenharmony_ci * you may not use this file except in compliance with the License. 51401458bSopenharmony_ci * You may obtain a copy of the License at 61401458bSopenharmony_ci * 71401458bSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 81401458bSopenharmony_ci * 91401458bSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 101401458bSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 111401458bSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 121401458bSopenharmony_ci * See the License for the specific language governing permissions and 131401458bSopenharmony_ci * limitations under the License. 141401458bSopenharmony_ci */ 151401458bSopenharmony_ci 161401458bSopenharmony_ci#ifndef NAPI_HISYSEVENT_RET_DEF_H 171401458bSopenharmony_ci#define NAPI_HISYSEVENT_RET_DEF_H 181401458bSopenharmony_ci 191401458bSopenharmony_cinamespace OHOS { 201401458bSopenharmony_cinamespace HiviewDFX { 211401458bSopenharmony_cinamespace NapiError { 221401458bSopenharmony_ci// common api error 231401458bSopenharmony_ciconstexpr int32_t ERR_PERMISSION_CHECK = 201; 241401458bSopenharmony_ciconstexpr int32_t ERR_NON_SYS_APP_PERMISSION = 202; 251401458bSopenharmony_ciconstexpr int32_t ERR_PARAM_CHECK = 401; 261401458bSopenharmony_ci 271401458bSopenharmony_ciconstexpr int32_t ERR_UNKNOWN = 11200000; 281401458bSopenharmony_ci 291401458bSopenharmony_ci// business error of write function 301401458bSopenharmony_ciconstexpr int32_t ERR_INVALID_DOMAIN = 11200001; 311401458bSopenharmony_ciconstexpr int32_t ERR_INVALID_EVENT_NAME = 11200002; 321401458bSopenharmony_ciconstexpr int32_t ERR_ENV_ABNORMAL = 11200003; 331401458bSopenharmony_ciconstexpr int32_t ERR_CONTENT_OVER_LIMIT = 11200004; 341401458bSopenharmony_ciconstexpr int32_t ERR_INVALID_PARAM_NAME = 11200051; 351401458bSopenharmony_ciconstexpr int32_t ERR_STR_LEN_OVER_LIMIT = 11200052; 361401458bSopenharmony_ciconstexpr int32_t ERR_PARAM_COUNT_OVER_LIMIT = 11200053; 371401458bSopenharmony_ciconstexpr int32_t ERR_ARRAY_SIZE_OVER_LIMIT = 11200054; 381401458bSopenharmony_ci 391401458bSopenharmony_ci// business error of addWatcher function 401401458bSopenharmony_ciconstexpr int32_t ERR_WATCHER_COUNT_OVER_LIMIT = 11200101; 411401458bSopenharmony_ciconstexpr int32_t ERR_WATCH_RULE_COUNT_OVER_LIMIT = 11200102; 421401458bSopenharmony_ci 431401458bSopenharmony_ci// business error of removeWatcher function 441401458bSopenharmony_ciconstexpr int32_t ERR_WATCHER_NOT_EXIST = 11200201; 451401458bSopenharmony_ci 461401458bSopenharmony_ci// business error of query function 471401458bSopenharmony_ciconstexpr int32_t ERR_QUERY_RULE_COUNT_OVER_LIMIT = 11200301; 481401458bSopenharmony_ciconstexpr int32_t ERR_INVALID_QUERY_RULE = 11200302; 491401458bSopenharmony_ciconstexpr int32_t ERR_CONCURRENT_QUERY_COUNT_OVER_LIMIT = 11200303; 501401458bSopenharmony_ciconstexpr int32_t ERR_QUERY_TOO_FREQUENTLY = 11200304; 511401458bSopenharmony_ciconstexpr int32_t ERR_REMOVE_SUBSCRIBE = 11200305; 521401458bSopenharmony_ci} 531401458bSopenharmony_ci 541401458bSopenharmony_cinamespace NapiInnerError { 551401458bSopenharmony_ciconstexpr int32_t ERR_INVALID_DOMAIN_IN_QUERY_RULE = 112003001; 561401458bSopenharmony_ciconstexpr int32_t ERR_INVALID_EVENT_NAME_IN_QUERY_RULE = 112003002; 571401458bSopenharmony_ci} 581401458bSopenharmony_ci 591401458bSopenharmony_cistatic constexpr int32_t NAPI_SUCCESS = 0; 601401458bSopenharmony_ci 611401458bSopenharmony_cistatic constexpr int32_t ERR_INVALID_PARAM_COUNT = -100; 621401458bSopenharmony_cistatic constexpr int32_t ERR_NAPI_PARSED_FAILED = -101; 631401458bSopenharmony_cistatic constexpr int32_t ERR_LISTENER_RULES_TYPE_NOT_ARRAY = -102; 641401458bSopenharmony_cistatic constexpr int32_t ERR_LISTENER_RULE_TYPE_INVALID = -103; 651401458bSopenharmony_cistatic constexpr int32_t ERR_QUERY_ARG_TYPE_INVALID = -104; 661401458bSopenharmony_cistatic constexpr int32_t ERR_QUERY_RULES_TYPE_NOT_ARRAY = -105; 671401458bSopenharmony_cistatic constexpr int32_t ERR_QUERY_RULE_TYPE_INVALID = -106; 681401458bSopenharmony_cistatic constexpr int32_t ERR_NAPI_LISTENER_NOT_FOUND = -107; 691401458bSopenharmony_ci} // namespace HiviewDFX 701401458bSopenharmony_ci} // namespace OHOS 711401458bSopenharmony_ci 721401458bSopenharmony_ci#endif // NAPI_HISYSEVENT_RET_DEF_H 731401458bSopenharmony_ci 74