diff --git a/utils/include/dm_error_message.h b/utils/include/dm_error_message.h index 52e22059..ba5dfe8e 100644 --- a/utils/include/dm_error_message.h +++ b/utils/include/dm_error_message.h @@ -16,10 +16,11 @@ #ifndef OHOS_DM_ERROMSG_H #define OHOS_DM_ERROMSG_H -#include #include "dm_log.h" #include "dm_constants.h" +#include + namespace OHOS { namespace DistributedHardware { std::string GetErrorString(int failedReason); diff --git a/utils/src/dm_error_message.cpp b/utils/src/dm_error_message.cpp index d9e24471..3f82bf28 100644 --- a/utils/src/dm_error_message.cpp +++ b/utils/src/dm_error_message.cpp @@ -17,14 +17,12 @@ namespace OHOS { namespace DistributedHardware { -typedef struct ERROR_INFO -{ +typedef struct ERROR_INFO { int errCode; std::string errMsg; -}ERROR_INFO; +} ERROR_INFO; -static ERROR_INFO g_errorMessages[] = -{ +static ERROR_INFO g_errorMessages[] = { {ERR_DM_FAILED, DM_FAILED_INFO}, {ERR_DM_TIME_OUT, DM_TIME_OUT_INFO}, {ERR_DM_NOT_INIT, DM_NOT_INIT_INFO}, @@ -59,9 +57,8 @@ static ERROR_INFO g_errorMessages[] = std::string GetErrorString(int failedReason) { std::string g_errorMessage = "dm process execution failed."; - for (int i =0; i