-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
error message with function name where the error occurs
- Loading branch information
Showing
12 changed files
with
74 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// rpc_error.cpp | ||
|
||
#include "rpc_error.h" | ||
#include "pixel_dtb.h" | ||
|
||
|
||
const char *CRpcError::GetMsg() | ||
{ | ||
switch (error) | ||
{ | ||
case OK: return "OK"; | ||
case TIMEOUT: return "TIMEOUT"; | ||
case WRITE_ERROR: return "WRITE_ERROR"; | ||
case READ_ERROR: return "READ_ERROR"; | ||
case READ_TIMEOUT: return "READ_TIMEOUT"; | ||
case MSG_UNKNOWN: return "MSG_UNKNOWN"; | ||
case WRONG_MSG_TYPE: return "WRONG_MSG_TYPE"; | ||
case WRONG_DATA_SIZE: return "WRONG_DATA_SIZE"; | ||
case ATB_MSG: return "ATB_MSG"; | ||
case WRONG_CGRP: return "WRONG_CGRP"; | ||
case WRONG_CMD: return "WRONG_CMD"; | ||
case CMD_PAR_SIZE: return "CMD_PAR_SIZE"; | ||
case NO_DATA_MSG: return "NO_DATA_MSG"; | ||
case NO_CMD_MSG: return "NO_CMD_MSG"; | ||
case UNKNOWN_CMD: return "UNKNOWN_CMD"; | ||
case UNDEF: return "UNDEF"; | ||
} | ||
return "?"; | ||
} | ||
|
||
|
||
void CRpcError::What() | ||
{ | ||
if (functionId >= 0) | ||
{ | ||
std::string fname(CTestboard::rpc_cmdName[functionId]); | ||
std::string fname_pretty; | ||
rpc_TranslateCallName(fname, fname_pretty); | ||
printf("\n%s\nERROR: %s\n", fname_pretty.c_str(), GetMsg()); | ||
} | ||
else | ||
printf("ERROR: %s\n", GetMsg()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters