1 /*
2  * Copyright (c) 2022 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 FILE_ACCESS_FRAMEWORK_ERRNO_H
17 #define FILE_ACCESS_FRAMEWORK_ERRNO_H
18 
19 #include "errors.h"
20 
21 namespace OHOS {
22 namespace FileAccessFwk {
23 
24 const int ERR_EXIST = 13900015;
25 const int ERR_NOMEM = 13900011;
26 const int ERR_PERM = 13900001;
27 const int ERR_URI = 13900002;
28 const int ERR_NOT_DIR = 13900018;
29 const int ERR_IS_DIR = 13900019;
30 const int BASE_OFFSET = 14300001;
31 enum {
32     ERR_OK = 0,
33     E_IPCS = BASE_OFFSET,                   // IPC error
34     E_URIS,                                 // Invalid uri
35     E_GETINFO,                              // Fail to get fileextension info
36     E_GETRESULT,                            // Get wrong result
37     E_REGISTER,                             // Fail to register notification
38     E_REMOVE,                               // Fail to remove notification
39     E_INIT_NOTIFY_AGENT,                    // Fail to init notification agent
40     E_NOTIFY,                               // Fail to notify agent
41     E_CONNECT,                              // Fail to connect file access extension ability
42     E_COUNT,                                // Too many records
43     E_CALLBACK_AND_URI_HAS_NOT_RELATIONS,   // Uri and callback do not has relations, can not unregister
44     E_CALLBACK_IS_NOT_REGISTER,             // CallBack is not registered, can not unregister
45     E_CAN_NOT_FIND_URI,                     // Can not find registered uri
46     E_DO_NOT_HAVE_PARENT,                   // Do not have parent uri in observerNode
47     E_LOAD_SA,                              // load SA failed
48     E_PERMISSION = 201,                     // Permission verification failed
49     E_PERMISSION_SYS                        // is not system app
50 };
51 } // namespace FileAccessFwk
52 } // namespace OHOS
53 #endif // FILE_ACCESS_FRAMEWORK_ERRNO_H