Example #1
0
/*
** Name: ex_handler	- SXF exception handler.
**
** Description:
**      This routine will catch all SXF exceptions. Any exception caught
**	by SXF is considered severe. SXF is marked as inconsistent and
**	all future callers will be returned an error.
**
** Inputs:
**      ex_args                         Exception arguments.
**
** Outputs:
**	none
**
** Returns:
**	EXDECLARE
**
** History:
**	9-july-1992 (markg)
**	    Initial creation.
**	12-jan-1993 (robf)
**	    Upgrade to new exception handling standard using ulx_exception()
**	    call.
**	10-mar-1993 (markg)
**	    Fixed typo in call to ulx_exception().
**	25-may-1993 (robf)
**	     New error message with appropriate params (fixes ule_format
**	     error on exceptions )
*/
static STATUS
ex_handler(
    EX_ARGS		*ex_args)
{
    /*
    ** Report the exception
    */
    ulx_exception (ex_args, DB_SXF_ID, E_SX10A1_SXF_EXCEPTION, TRUE);

    if (Sxf_svcb != NULL)
	Sxf_svcb->sxf_svcb_status |= SXF_CHECK;

    return (EXDECLARE);
}
Example #2
0
/*{
** Name: opx_exception	- handle unknown exception for optimizer
**
** Description:
**      This routine will handle unknown exceptions for the optimizer
**
** Inputs:
**      ex_args                         argument list from exception handler
**
** Outputs:
**	Returns:
**	    STATUS - appropriate CL return code for exception handler
**	Exceptions:
**
**
** Side Effects:
**
**
** History:
**      20-jan-87 (seputis)
**	    initial creation
**      7-nov-88 (seputis)
**          use EXsys_report
**      26-jun-91 (seputis)
**          added check for OPC access violations
**	11-mar-92 (rog)
**	    Use EXsys_report for everything, not just EXSEGVIO.  Call
**	    scs_avformat to dump info about the offending session.  Remove
**	    underscores from EX return statuses.
**	02-jul-1993 (rog)
**	    Call ulx_exception() to handle all of the reporting duties.
**	    OPF should need to call adx_handler, so remove call to
**	    opx_adfexception().
[@history_line@]...
[@history_template@]...
*/
STATUS
opx_exception(
	EX_ARGS            *args)
{
    /* unexpected exception so record the error and return to
    ** deallocate resources */

    OPS_CB	*opscb; /* session control block */
    OPF_CB	*opfcb; /* caller's control block */
    OPX_ERROR	errorcode; /* error code for exception */

    opscb = ops_getcb();	/* get optimizer session control block */
    opfcb = opscb->ops_state->ops_caller_cb; /* report unexpected exception
                                ** otherwise */
    if (opfcb->opf_errorblock.err_code == E_OP0082_UNEXPECTED_EX)
    {	/* try to check for exception within an exception as soon as possible */
	errorcode = E_OP0083_UNEXPECTED_EXEX; /* second exception
				** occurred so do not deallocate
				** any resources */
	opscb->ops_retstatus = E_DB_SEVERE; /* make sure an high enough priority
                                ** error is reported */
    }
    else
    {
	if (opscb->ops_state->ops_gmask & OPS_OPCEXCEPTION)
	    errorcode = E_OP08A2_EXCEPTION; /* check for exception in
				** OPC component of OPF */
	else
	    errorcode = E_OP0082_UNEXPECTED_EX; /* check for exception
				** in non-OPC components of OPF */
    }

    ulx_exception( args, DB_OPF_ID, E_OP0901_UNKNOWN_EXCEPTION, TRUE);

    if (opscb->ops_retstatus != E_DB_SEVERE
	&&
	opscb->ops_retstatus != E_DB_FATAL)
	opscb->ops_retstatus = E_DB_ERROR; /* make sure an high enough priority
                                ** error is reported */
    opx_rerror(opscb->ops_state->ops_caller_cb, errorcode);/*log error*/
    return (EXDECLARE);        /* return to exception handler declaration pt */
}