ODA IFC SDK Developer's Guide > Standard Data Access Interface in IFC SDK > Standard Data Access Interface Error Handling
Standard Data Access Interface Error Handling

The Standard Data Access Interface (SDAI) processes error events and exceptions using the following functionality:

  • Error codes that are generated by the SDAI functions. An error code indicates the type of error that has occurred during an SDAI operation and can be retrieved independently right after performing the appropriate operation or function call. These error codes can be processed in custom applications.

    To retrieve the last error that occurred, use the sdaiErrorQuery() function. This function returns the code of the error that occurred during the most recent call of an SDAI function that finished with an error, not the error that occurred during the most recent call of an SDAI function.

    The sdaiErrorQuery() function call clears the error code; you can retrieve the latest error code only once.

    To track an error that occurred during a specific SDAI function call, call the sdaiErrorQuery() function before calling the needed function to clear the code of the error that recently occurred; after the specific function finishes, run the sdaiErrorQuery() function again to get the error code if an error occurred and check it.

  • Exception handling. There is a default error handler that is called when an exception occurs. The default implementation prints the error message to the standard output stream.

    It is possible to set other error handling functions using the sdaiSetErrorHandler() function which adds a specified handler function to the top of the handlers stack supported by IFC SDK.

    To take the top handler function from the stack, use the sdaiRestoreErrorHandler() function which removes the top handler from the stack and restores either the next handler if it exists in the stack or the default handler if the stack is empty.

  • Many SDAI functions return result codes, which illustrate the result of function calls.

For detailed information about working with the SDAI implementation, see the following topics:

Error Codes

Code Value Description
sdaiNO_ERR 0 No error
sdaiSS_OPN 10 Session open
sdaiSS_NAVL 20 SDAI not available
sdaiSS_NOPN 30 Session is not open
sdaiRP_NEXS 40 Repository does not exist
sdaiRP_NAVL 50 Repository not available
sdaiRP_OPN 60 Repository open
sdaiRP_NOPN 70 Repository is not open
sdaiTR_EAB 80 Transaction ended abnormally
sdaiTR_EXS 90 Transaction exists
sdaiTR_NAVL 100 Transaction currently not available
sdaiTR_RW 110 Transaction is read-write
sdaiTR_NRW 120 Transaction is not read-write
sdaiTR_NEXS 130 Transaction does not exist
sdaiMO_NDEQ 140 SDAI-model not domain equivalent
sdaiMO_NEXS 150 SDAI-model does not exist
sdaiMO_NVLD 160 SDAI-model invalid
sdaiMO_DUP 170 SDAI-model duplicate
sdaiMX_NRW 180 SDAI-model access is not read-write
sdaiMX_NDEF 190 SDAI-model access is not defined
sdaiMX_RW 200 SDAI-model access is read-write
sdaiMX_RO 210 SDAI-model access is read-only
sdaiSD_NDEF 220 Schema definition is not defined
sdaiED_NDEF 230 Entity definition is not defined
sdaiED_NDEQ 240 Entity definition is not domain equiv
sdaiED_NVLD 250 Entity definition is invalid
sdaiRU_NDEF 260 Rule is not defined
sdaiEX_NSUP 270 Expression evaluation not supported
sdaiAT_NVLD 280 Attribute is invalid
sdaiAT_NDEF 290 Attribute is not defined
sdaiSI_DUP 300 Schema instance duplicate
sdaiSI_NEXS 310 Schema instance does not exist
sdaiEI_NEXS 320 Entity instance does not exist
sdaiEI_NAVL 330 Entity instance is not available
sdaiEI_NVLD 340 Entity instance is invalid
sdaiEI_NEXP 350 Entity instance is not exported
sdaiSC_NEXS 360 Scope does not exist
sdaiSC_EXS 370 Scope exists
sdaiAI_NEXS 380 Aggregate instance does not exist
sdaiAI_NVLD 390 Aggregate instance is invalid
sdaiAI_NSET 400 Aggregate instance is empty
sdaiVA_NVLD 410 Value is invalid
sdaiVA_NEXS 420 Value does not exist
sdaiVA_NSET 430 Value is not set
sdaiVT_NVLD 440 Value type is invalid
sdaiIR_NEXS 450 Iterator does not exist
sdaiIR_NSET 460 Current member is not defined
sdaiIX_NVLD 470 Index invalid
sdaiER_NSET 480 Event recording is not set
sdaiOP_NVLD 490 Operator is invalid
sdaiFN_NAVL 500 Function not available
sdaiAB_NEXS 800 ADB does not exist
sdaiSY_ERR 1000 Underlying system error

See Also

Access to Representation Body Geometry

Data Access Mechanisms

Copyright © 2002 – 2020. Open Design Alliance. All rights reserved.