1 /* 2 * Copyright (c) 2020 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 #include "ability_callback_utils.h" 17 18 namespace OHOS { ObtainErrorMessage(uint8_t errorCode)19std::string ObtainErrorMessage(uint8_t errorCode) 20 { 21 switch (errorCode) { 22 case PARAM_NULL_ERROR: 23 return "PARAM_NULL_ERROR"; 24 case MEMORY_MALLOC_ERROR: 25 return "MEMORY_MALLOC_ERROR"; 26 case DUMP_ABILITIES_ERROR: 27 return "DUMP_ABILITIES_ERROR"; 28 case IPC_REQUEST_ERROR: 29 return "IPC_REQUEST_ERROR"; 30 case SERIALIZE_ERROR: 31 return "SERIALIZE_ERROR"; 32 case CREATE_APPTASK_ERROR: 33 return "CREATE_APPTASK_ERROR"; 34 case SCHEDULER_LIFECYCLE_ERROR: 35 return "SCHEDULER_LIFECYCLE_ERROR"; 36 case PARAM_CHECK_ERROR: 37 return "PARAM_CHECK_ERROR"; 38 case COMMAND_ERROR: 39 return "COMMAND_ERROR"; 40 default: { 41 return ""; 42 } 43 } 44 } 45 } // namespace