1 /*
2  * Copyright (c) 2022-2024 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 HIAPPEVENT_FRAMEWORKS_JS_NAPI_INCLUDE_NAPI_ERROR_H
17 #define HIAPPEVENT_FRAMEWORKS_JS_NAPI_INCLUDE_NAPI_ERROR_H
18 
19 namespace OHOS {
20 namespace HiviewDFX {
21 namespace NapiError {
22 constexpr int ERR_OK = 0;
23 // common api error
24 constexpr int ERR_PARAM = 401;
25 
26 // business error of write function
27 constexpr int ERR_DISABLE = 11100001;
28 constexpr int ERR_INVALID_DOMAIN = 11101001;
29 constexpr int ERR_INVALID_NAME = 11101002;
30 constexpr int ERR_INVALID_PARAM_NUM = 11101003;
31 constexpr int ERR_INVALID_STR_LEN = 11101004;
32 constexpr int ERR_INVALID_KEY = 11101005;
33 constexpr int ERR_INVALID_ARR_LEN = 11101006;
34 constexpr int ERR_INVALID_CUSTOM_PARAM_NUM = 11101007;
35 
36 // business error of addWatcher function
37 constexpr int ERR_INVALID_WATCHER_NAME = 11102001;
38 constexpr int ERR_INVALID_FILTER_DOMAIN = 11102002;
39 constexpr int ERR_INVALID_COND_ROW = 11102003;
40 constexpr int ERR_INVALID_COND_SIZE = 11102004;
41 constexpr int ERR_INVALID_COND_TIMEOUT = 11102005;
42 
43 // business error of configure function
44 constexpr int ERR_INVALID_MAX_STORAGE = 11103001;
45 
46 // business error of AppEventPackageHolder.setSize function
47 constexpr int ERR_INVALID_SIZE = 11104001;
48 
49 } // namespace NapiError
50 } // namespace HiviewDFX
51 } // namespace OHOS
52 #endif // HIAPPEVENT_FRAMEWORKS_JS_NAPI_INCLUDE_NAPI_ERROR_H