// file: ngrn_error_0.cc
//
 
// isip include files
//
#include "ngram_node.h"
#include "ngram_node_constants.h"
 
// method: error_handler_cc
//
// arguments:
//  char_1* mname: (input) method name in which the error occurred
//  char_1* msg: (input) message to be printed
//
// return: none
//
// this method displays an error message
//
volatile void Ngram_node::error_handler_cc(char_1* mname_a, char_1* msg_a) {
  
  // display a message
  //
  if (mname_a != (char_1*)NULL) {
    
    // check for no message
    //
    if (msg_a != (char_1*)NULL) {
      fprintf(stdout, "%s::%s: %s\n", NGRAM_NODE_CLASS_NAME, mname_a, msg_a);
    }
    else {
      fprintf(stdout, "%s::%s: fatal error\n", NGRAM_NODE_CLASS_NAME, mname_a);
    }
  }
  
  // exit very ungracefully
  //
  exit(ISIP_PROTO_ERROR);
}
