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 WEB_ERRORS_H 17 #define WEB_ERRORS_H 18 19 #include "errors.h" 20 21 #include <string> 22 23 namespace OHOS { 24 namespace NWebError { 25 constexpr ErrCode NWEB_ERROR = -1; 26 constexpr ErrCode NO_ERROR = 0; 27 28 constexpr ErrCode PARAM_CHECK_ERROR = 401; 29 constexpr ErrCode INIT_ERROR = 17100001; 30 constexpr ErrCode INVALID_URL = 17100002; 31 constexpr ErrCode INVALID_RESOURCE = 17100003; 32 constexpr ErrCode FUNCTION_NOT_ENABLE = 17100004; 33 constexpr ErrCode INVALID_COOKIE_VALUE = 17100005; 34 constexpr ErrCode CAN_NOT_REGISTER_MESSAGE_EVENT = 17100006; 35 constexpr ErrCode CANNOT_DEL_JAVA_SCRIPT_PROXY = 17100008; 36 constexpr ErrCode CANNOT_ZOOM_IN_OR_ZOOM_OUT = 17100009; 37 constexpr ErrCode CAN_NOT_POST_MESSAGE = 17100010; 38 constexpr ErrCode INVALID_ORIGIN = 17100011; 39 constexpr ErrCode NO_WEBSTORAGE_ORIGIN = 17100012; 40 constexpr ErrCode NEW_OOM = 17100013; 41 42 std::string GetErrMsgByErrCode(ErrCode code); 43 } 44 } 45 #endif