The mi_error_level() function

The mi_error_level() function retrieves from an error descriptor the exception level associated with an exception or an error level associated with a client LIBMI error.

Syntax

mi_integer mi_error_level(err_desc)
   MI_ERROR_DESC *err_desc;
err_desc
A pointer to an error descriptor that describes an MI_Exception or MI_Client_Library_Error event.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

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:
  • If err_desc references an MI_Exception event, mi_error_level() returns either of the following exception levels for the database server exception.
    Exception level Exception-level constant
    Warning MI_MESSAGE
    Runtime error MI_EXCEPTION

    This function is useful in an exception callback to get the exception level associated with an MI_Exception event (an SQL error or warning).

  • If err_desc references an MI_Client_Library_Error event, mi_error_level() returns one of the following error levels for the client LIBMI error.
    Exception level Exception-level constant
    Bad argument to DataBlade® API function MI_LIB_BADARG
    Unable to connect to database server MI_LIB_BADSERV
    Lost connection to database server MI_LIB_DROPCONN
    Internal DataBlade API error MI_LIB_INTERR
    Feature or function not currently implemented MI_LIB_NOIMP
    DataBlade API function called out of sequence MI_LIB_USAGE

    This function is useful in a client LIBMI callback to get the precise type of error associated with an MI_Client_Library_Error event.

For a general discussion on how to obtain information from an error descriptor, see the HCL OneDB™ DataBlade API Programmer's Guide.

Return values

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
The function was not successful.