refactor: adjust error codes
This commit is contained in:
parent
9dfb554cec
commit
79f660a222
|
@ -40,9 +40,10 @@ int32_t* taosGetErrno();
|
|||
#define TSDB_CODE_FAILED -1 // unknown or needn't tell detail error
|
||||
|
||||
//common & util
|
||||
#define TSDB_CODE_ACTION_IN_PROGRESS TAOS_DEF_ERROR_CODE(0, 0x0001)
|
||||
#define TSDB_CODE_APP_NOT_READY TAOS_DEF_ERROR_CODE(0, 0x0002)
|
||||
#define TSDB_CODE_APP_ERROR TAOS_DEF_ERROR_CODE(0, 0x0003)
|
||||
#define TSDB_CODE_RSP_IN_APP TAOS_DEF_ERROR_CODE(0, 0x0001)
|
||||
#define TSDB_CODE_CLEAN_AND_RSP_IN_APP TAOS_DEF_ERROR_CODE(0, 0x0002)
|
||||
#define TSDB_CODE_APP_NOT_READY TAOS_DEF_ERROR_CODE(0, 0x000A)
|
||||
#define TSDB_CODE_APP_ERROR TAOS_DEF_ERROR_CODE(0, 0x000B)
|
||||
#define TSDB_CODE_OUT_OF_MEMORY TAOS_DEF_ERROR_CODE(0, 0x0011)
|
||||
#define TSDB_CODE_OUT_OF_RANGE TAOS_DEF_ERROR_CODE(0, 0x0011)
|
||||
#define TSDB_CODE_OUT_OF_SHM_MEM TAOS_DEF_ERROR_CODE(0, 0x0012)
|
||||
|
|
|
@ -134,10 +134,9 @@ SMgmtWrapper *dmAcquireWrapper(SDnode *pDnode, EDndNodeType nType);
|
|||
int32_t dmMarkWrapper(SMgmtWrapper *pWrapper);
|
||||
void dmReleaseWrapper(SMgmtWrapper *pWrapper);
|
||||
SMgmtInputOpt dmBuildMgmtInputOpt(SMgmtWrapper *pWrapper);
|
||||
|
||||
void dmSetStatus(SDnode *pDnode, EDndRunStatus stype);
|
||||
void dmProcessServerStartupStatus(SDnode *pDnode, SRpcMsg *pMsg);
|
||||
void dmProcessNetTestReq(SDnode *pDnode, SRpcMsg *pMsg);
|
||||
void dmSetStatus(SDnode *pDnode, EDndRunStatus stype);
|
||||
int32_t dmProcessServerStartupStatus(SDnode *pDnode, SRpcMsg *pMsg);
|
||||
int32_t dmProcessNetTestReq(SDnode *pDnode, SRpcMsg *pMsg);
|
||||
|
||||
// dmNodes.c
|
||||
int32_t dmOpenNode(SMgmtWrapper *pWrapper);
|
||||
|
|
|
@ -277,7 +277,7 @@ static void dmGetServerStartupStatus(SDnode *pDnode, SServerStatusRsp *pStatus)
|
|||
}
|
||||
}
|
||||
|
||||
void dmProcessNetTestReq(SDnode *pDnode, SRpcMsg *pMsg) {
|
||||
int32_t dmProcessNetTestReq(SDnode *pDnode, SRpcMsg *pMsg) {
|
||||
dDebug("msg:%p, net test req will be processed", pMsg);
|
||||
SRpcMsg rsp = {.code = 0, .info = pMsg->info};
|
||||
rsp.pCont = rpcMallocCont(pMsg->contLen);
|
||||
|
@ -287,9 +287,10 @@ void dmProcessNetTestReq(SDnode *pDnode, SRpcMsg *pMsg) {
|
|||
rsp.contLen = pMsg->contLen;
|
||||
}
|
||||
rpcSendResponse(&rsp);
|
||||
return TSDB_CODE_RSP_IN_APP;
|
||||
}
|
||||
|
||||
void dmProcessServerStartupStatus(SDnode *pDnode, SRpcMsg *pMsg) {
|
||||
int32_t dmProcessServerStartupStatus(SDnode *pDnode, SRpcMsg *pMsg) {
|
||||
dDebug("msg:%p, server startup status req will be processed", pMsg);
|
||||
SServerStatusRsp statusRsp = {0};
|
||||
dmGetServerStartupStatus(pDnode, &statusRsp);
|
||||
|
@ -313,4 +314,5 @@ void dmProcessServerStartupStatus(SDnode *pDnode, SRpcMsg *pMsg) {
|
|||
|
||||
_OVER:
|
||||
rpcSendResponse(&rspMsg);
|
||||
return TSDB_CODE_RSP_IN_APP;
|
||||
}
|
||||
|
|
|
@ -46,7 +46,8 @@ STaosError errors[] = {
|
|||
#endif
|
||||
|
||||
//common & util
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_ACTION_IN_PROGRESS, "Action in progress")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_RSP_IN_APP, "Cleanup in App")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_CLEAN_AND_RSP_IN_APP, "Cleanup and rsp in App")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_APP_NOT_READY, "Database not ready")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_APP_ERROR, "Database internal error")
|
||||
TAOS_DEFINE_ERROR(TSDB_CODE_OUT_OF_MEMORY, "Out of Memory")
|
||||
|
|
Loading…
Reference in New Issue