mi_integer mi_error_level(err_desc)
MI_ERROR_DESC *err_desc;
The mi_error_level( ) function returns an error level from the error descriptor that err_desc references. This error level can be either an exception level for a database server exception or an error level for a client LIBMI error:
This function is useful in an exception callback to get the exception level associated with an MI_Exception event (an SQL error or warning).
Exception Level | Exception-Level Constant |
---|---|
Bad argument to DataBlade API function |
|
Unable to connect to database server |
|
Lost connection to database server |
|
Internal DataBlade API error |
|
Feature or function not currently implemented |
|
DataBlade API function called out of sequence |
This function is useful in a client LIBMI callback to get the precise type of error associated with an MI_Client_Library_Error event.
MI_LIB_BADARG MI_LIB_USAGE MI_LIB_INTERR MI_LIB_NOIMP MI_LIB_DROPCONN MI_LIB_BADSERV |
Any of these values indicates that the event that the error descriptor describes is MI_Client_Library_Error. The return value indicates the cause of the client LIBMI error. |
MI_MESSAGE MI_EXCEPTION |
Either of these values indicates that the event that the error descriptor describes is MI_Exception. The return value indicates the type of exception: warning (MI_MESSAGE) or error (MI_EXCEPTION). |
MI_ERROR |
This value indicates that the function was not successful. |
See also the descriptions of mi_errmsg( ), mi_error_desc_copy( ), mi_error_desc_destroy( ), mi_error_desc_finish( ), mi_error_desc_is_copy( ), mi_error_desc_next( ), mi_error_sql_state( ), and mi_error_sqlcode( ).
For a general discussion on how to obtain information from an error descriptor, see the IBM Informix: DataBlade API Programmer's Guide.