• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2023-2023 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  * Description: supply napi errors for interfaces.
15  * Author: zhangjingnan
16  * Create: 2023-4-11
17  */
18 
19 #ifndef NAPI_ERRORS_H
20 #define NAPI_ERRORS_H
21 
22 #include <map>
23 #include "cast_engine_errors.h"
24 
25 namespace OHOS {
26 namespace CastEngine {
27 namespace NapiErrors {
28 static std::map<int32_t, int32_t> errcode_ = {
29     { CAST_ENGINE_ERROR, CAST_ENGINE_ERROR },
30     { ERR_NO_MEMORY, ERR_NO_MEMORY },
31     { ERR_SESSION_NOT_EXIST, ERR_SESSION_NOT_EXIST },
32     { ERR_SERVICE_STATE_NOT_MATCH, ERR_SERVICE_STATE_NOT_MATCH },
33     { ERR_SESSION_STATE_NOT_MATCH, ERR_SESSION_STATE_NOT_MATCH },
34     { ERR_NO_PERMISSION, ERR_NO_PERMISSION },
35     { ERR_INVALID_PARAM, ERR_INVALID_PARAM }
36 };
37 }
38 } // namespace CastEngine
39 } // namespace OHOS
40 
41 #endif // CAST_ENGINE_ERRORS_H