sdaiErrorQuery


Returns the _EDMinterface_ error code, i.e., the last error code generated by an EDMinterface operation since the last invocation of the sdaiErrorQuery function. If no error is detected in EDMinterface since the last invocation of the sdaiErrorQuery function the error code sdaiENOERROR is returned. The error code sdaiENOERROR has the value zero. The sdaiErrorQuery operation resets the _EDMinterface_ error code to sdaiENOERROR, i.e. to zero.
The invocation of the sdaiErrorQuery operation is the only way to check if an EDMinterface function is successfully performed or not if the actual EDMinterface function does not return a completion code. Most of the EDMinterface specific functions returns such a completion code, but most of the ISO 10303-22 defined SDAI operations does not return any completion code.
The function edmiGetErrorText can be used to get the error message of an _EDMinterface_ error code.
The EDMinterface can be configured to return only the error codes defined in ISO 10303-22: The Standard Access Interface (SDAI) or also to return EDMinterface specific error codes to get more detailed error reasons and error descriptions.
Related functions: sdaiSetErrorHandler , sdaiGetErrorHandler , edmiGetErrorText
Header:
#include "sdai.h"
Prototype:
SdaiErrorCode sdaiErrorQuery(void);
Returns:
An error code edmiErrNo that defines the latest _EDMinterface_ error is returned:
edmiErrNo = 0 (= sdaiENOERROR) : No _EDMinterface_ error detected since last invocation of sdaiErrorQuery.
edmiErrNo != 0 : error code. Use edmiGetErrorText to get error message or see documentation for description.
Example:
SdaiRepository repository;
SdaiSchema schema;
SdaiModel modelId;
SdaiErrorCode errCode;
...
modelId = sdaiCreateModelBN (repository, "Building_AXD67H", "IFC151");
if (! modelId) {
/* Error in operation */ 
printf("\nError: %s in sdaiCreateModelBN \n", 
edmiGetErrorText(sdaiErrorQuery())); 
goto error; 
}
. . .
sdaiDeleteModel(modelId);
errCode = sdaiErrorQuery();
if (errCode) {
/* Error in operation */ 
printf("\nError: %s in sdaiDeleteModel \n", 
edmiGetErrorText(errCode)); 
goto error; 
}