// error_handling.c - some useful error handling functions

#include <stdio.h>

//------------------------------------------------------------
// used if a function is called but has an illegal state
void exitOnFatalErrorIllegalState(char* func_name)
{
  printf("Fatal Error: IllegalState in function %s\n",func_name);
  exit(-2);
}

//------------------------------------------------------------
// used if the program runs out of memory
void exitOnFatalErrorOutOfMemory()
{
  printf("Fatal Error: Out of Memory\n");
  exit(-1);
}

//------------------------------------------------------------
// used if a function gets an illegal argument
void exitOnFatalErrorIllegalArgument(char* func_name)
{
  printf("Fatal Error: IllegalArgument in function %s\n",
         func_name);
  exit(-2);
}
