1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef NAPI_HISYSEVENT_RET_DEF_H 17 #define NAPI_HISYSEVENT_RET_DEF_H 18 19 namespace OHOS { 20 namespace HiviewDFX { 21 namespace NapiError { 22 // common api error 23 constexpr int32_t ERR_PERMISSION_CHECK = 201; 24 constexpr int32_t ERR_PARAM_CHECK = 401; 25 26 constexpr int32_t ERR_UNKNOWN = 11200000; 27 28 // business error of write function 29 constexpr int32_t ERR_INVALID_DOMAIN = 11200001; 30 constexpr int32_t ERR_INVALID_EVENT_NAME = 11200002; 31 constexpr int32_t ERR_ENV_ABNORMAL = 11200003; 32 constexpr int32_t ERR_CONTENT_OVER_LIMIT = 11200004; 33 constexpr int32_t ERR_INVALID_PARAM_NAME = 11200051; 34 constexpr int32_t ERR_STR_LEN_OVER_LIMIT = 11200052; 35 constexpr int32_t ERR_PARAM_COUNT_OVER_LIMIT = 11200053; 36 constexpr int32_t ERR_ARRAY_SIZE_OVER_LIMIT = 11200054; 37 38 // business error of addWatcher function 39 constexpr int32_t ERR_WATCHER_COUNT_OVER_LIMIT = 11200101; 40 constexpr int32_t ERR_WATCH_RULE_COUNT_OVER_LIMIT = 11200102; 41 42 // business error of removeWatcher function 43 constexpr int32_t ERR_WATCHER_NOT_EXIST = 11200201; 44 45 // business error of query function 46 constexpr int32_t ERR_QUERY_RULE_COUNT_OVER_LIMIT = 11200301; 47 constexpr int32_t ERR_INVALID_QUERY_RULE = 11200302; 48 constexpr int32_t ERR_CONCURRENT_QUERY_COUNT_OVER_LIMIT = 11200303; 49 constexpr int32_t ERR_QUERY_TOO_FREQUENTLY = 11200304; 50 } 51 52 namespace NapiInnerError { 53 constexpr int32_t ERR_INVALID_DOMAIN_IN_QUERY_RULE = 112003001; 54 constexpr int32_t ERR_INVALID_EVENT_NAME_IN_QUERY_RULE = 112003002; 55 } 56 57 static constexpr int32_t NAPI_SUCCESS = 0; 58 59 static constexpr int32_t ERR_INVALID_PARAM_COUNT = -100; 60 static constexpr int32_t ERR_NAPI_PARSED_FAILED = -101; 61 static constexpr int32_t ERR_LISTENER_RULES_TYPE_NOT_ARRAY = -102; 62 static constexpr int32_t ERR_LISTENER_RULE_TYPE_INVALID = -103; 63 static constexpr int32_t ERR_QUERY_ARG_TYPE_INVALID = -104; 64 static constexpr int32_t ERR_QUERY_RULES_TYPE_NOT_ARRAY = -105; 65 static constexpr int32_t ERR_QUERY_RULE_TYPE_INVALID = -106; 66 static constexpr int32_t ERR_NAPI_LISTENER_NOT_FOUND = -107; 67 } // namespace HiviewDFX 68 } // namespace OHOS 69 70 #endif // NAPI_HISYSEVENT_RET_DEF_H 71 72