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


5.7 Running handlers from handlers

It is sometimes useful to execute complex code in an exception–handler code block; for example we may need to map a set of exceptional–condition objects into another set. Whenever an exception–handler code block needs to handle exceptions itself, we must register the outer handlers as inner handlers; CCExceptions offers functions to do this with ease.

The basic code template is this:

cce_location_t  outer_L[1];

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

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

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

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