Sending NAG C library errors to the GAUDI Message Service

The GaudiNagC package in the Gaudi software distribution contains classes to handle NAG C library errors within Gaudi. Please note that the current release only allows to create one instance of the GaudiErrorHandler class. The following steps are needed in order to use them in your algorithm: The default behaviour of this service is given by the execute() method of the GaudiErrorHandler class. If you wish to have a different behaviour, you should write your own class derived from GaudiErrorHandler, reimplement the execute() method, then use your new class instead of GaudiErrorHandler.

The implementation of GaudiErrorHandler::execute() is shown below:

void GaudiErrorHandler::execute(char *string, int code, char *name) {

 MsgStream log(messageSvc(), algName());
 if (code != NE_NOERROR ) {
  if( !strncmp( string, "NE", 2 )) {
     log << MSG::ERROR << " from " << name << " (NAG): " << string << endreq;
  }
  else {
     log << MSG::WARNING << " from " << name << " (NAG): " << string << endreq;
  }
 }
 else {
    log << MSG::INFO << name << " (NAG) called successfully" << endreq;
 }
}