ex2.cc

An example using the Exception class

using namespace std;

#include <Exception.h>

#include "TraceFct.h"

void f2( )
{
  Exception ex( "My First Problem" );

  ex.set_message( "My Second Problem" );
  ex.set_message( "My Third Problem" );
  ex.set_message( "My Liney\nFourth Problem" );

  throw ex;
}

void f1( )
{
  TraceFct tf( "f1" );

  try { 
    f2();
  } catch( Exception& e) 
  {
    tf.exit( 1, e );
  }
}

int main( int argc, char * argv[] )
{
  TraceFct tf( argv[0], 0, -1 );

  f1( );

  tf.close( );
  
  tf.message( "main stack dump\n" );
  tf.dump_stack( );

  return EXIT_SUCCESS;
}


Generated on Mon Oct 20 13:55:17 2008 for tracefctxx by  doxygen 1.5.6