Next: , Previous: , Up: handlers handlers   [Contents][Index]


5.7.3 Using an error handler to run clean handlers

Function: void cce_register_error_handler_to_run_body_handlers (cce_destination_t inner_L, cce_error_handler_t * inner_H, cce_destination_t outer_L)

Register the error handler inner_H, in the context of the location inner_L, so that it will run the clean handlers registered for the location outer_L. The exceptional–condition object associated to outer_L will be deleted by the handler.

We can use this function as follows:

cce_location_t  outer_L[1];

if (cce_location(outer_L)) {
  /* outer exception handler */
  cce_location_t       inner_L[1];
  cce_error_handler_t  inner_H[1];

  if (cce_location(inner_L)) }
    /* inner exception handler */
    cce_run_catch_handlers_final(inner_L);
  } else {
    cce_register_error_handler_to_run_body_handlers(inner_L, inner_H,
      cce_resource_pointer(outer_L));
    /* inner body */
    cce_run_body_handlers(inner_L);
  }
} else {
  /* outer body */
  cce_run_body_handlers(outer_L);
}

Next: , Previous: , Up: handlers handlers   [Contents][Index]

This document describes version 0.9.0-devel.3 of CCExceptions.