Adds a user defined error code to the list of EDMinterface error codes.
Related functions: edmiGetErrorText
Header:
#include "sdai.h"
Prototype:
EdmiError edmiDefineErrorCode(EdmiError errorCode,
SdaiString errorText,
SdaiOptions options);
Arguments:
errorCode |
The new EDMinterface error code to define. Error codes shall be within the range limited by the symbols FIRST_USER_DEFINED_ERROR_CODE and LAST_USER_DEFINED_ERROR_CODE |
errorText |
An error message that corresponds to the given EDMinterface error code |
options |
Specifies the current options. The <options> value should be defined as a bitwise OR between the options to enable. All the option names are defined in the header file sdai.h . Default options are enabled when the value of <options> is set to zero. |
Option Description
REPLACE_EXISTING |
|
DELETE_EXISTING |
|
Returns:
A completion code of datatype EdmiError is the returned function value. The completion code has the following values:
Completion code = 0 : Operation successfully performed.
Completion code != 0: Error in operation. Completion code is an EDMinterface error code. Use edmiGetErrorText to get the error text corresponding to the error code.
EXAMPLE
#define XC_UNCOMPLETE = (FIRST_USER_DEFINED_ERROR_CODE + 0)
#define XC_MISSING = (FIRST_USER_DEFINED_ERROR_CODE + 1)
#define XC_ACCEPTED = (FIRST_USER_DEFINED_ERROR_CODE + 2)
. . .
edmiDefineErrorCode(XC_UNCOMPLETE,
"XC-Uncompletely Populated",
REPLACE_EXISTING);
edmiDefineErrorCode(XC_MISSING,
"XC-Population Missing",
REPLACE_EXISTING);
edmiDefineErrorCode(XC_ACCEPTED,
"XC-Population Ok",
REPLACE_EXISTING);
. . .
EdmiError rstat, userStatus;
SdaiModel xc49Id;
SdaiInteger nErr, nWrn;
. . .
if (rstat = edmiConvertModelsBN("xc_repository.xc32", "xc32_to xc49",
"xc_repository.xc49",
NULL, NULL, NULL, 0, NULL, 0,
&xc49Id, &userStatus,
&nWrn, &nErr)) {
goto error;
} else {
if (userStatus != XC_ACCEPTED) {
printf("\nError in : xc32_to xc49 mapping - %s\n",
edmiGetErrorText(userStatus));
goto error;
}
}
...
edmiDefineErrorCode(dllMissingErr, dllMissingMsg, REPLACE_EXISTING);