The eXtremeDB runtime returns integer codes indicating success or failure for most C API functions. The runtime returns three different types of return code:
- Status Codes (MCO_S_*): indicate runtime states that can and will occur during normal database operations;
- Non-Fatal Error Codes (MCO_E_*): indicate runtime error conditions that the application can manage by responding appropriately; and
- Fatal Error Codes (MCO_ERR_*): indicate bugs in the application code that render the runtime unable to safely continue execution.
The following function code from the runtime file
mcocsr.cillustrates the use of each of the three return code types:MCO_RET mco_cursor_check(mco_trans_h t, mco_cursor_h c0) { mco_scursor_t* c = (mco_scursor_t*)(c0); mco_objhandle_t obj; MCO_RET rc; #ifdef MCO_CFG_CHECKLEVEL_1 if (!CHECK_TRANSACTION((mco_db_connection_h)t)) { mco_stop(MCO_ERR_TRN + 5); } #endif if (c->mark != MCO_DB_CURSOR_MARK || c->endmark != MCO_DB_CURSOR_MARK) { return MCO_E_INVALID_HANDLE; } rc = mco_w_obj_from_cursor(t, c0, c->csr_class_code, &obj); if (rc != MCO_S_OK) { return MCO_E_CURSOR_INVALID; } return MCO_S_OK; }Note that the MCO_S_* and MCO_E_* type return codes are returned directly from the runtime function to be managed by the application code. But the MCO_ERR_* type return codes are passed to the runtime function
mco_stop()to terminate execution. Fatal error conditions can cause a runtime exception or, in C and C++ applications, can be trapped by a fatal error handler; if a fatal error handler is not registered for the application, a fatal error can cause the application to appear to hang. Please see the Fatal Error Codes page for further explanation of these return codes and how to determine their cause.Please use the links below to view the meanings for the different categories of eXtremeDB return codes:
Values 0 through 19Values 49 through 99 and 999Values 100 through 199Values 200 through 299Values 300 through 399Values 400 through 499Values 500 through 599Values 600 through 699Values 700 through 799Values 800 through 899Values 900 through 998Values 1000 through 1100Values 1200 through 1299Values 100000 through 1999999Values 0 through 10Values 0 through 11