#ifndef ONERROR_DEF
 #define ONERROR_DEF


//------------------------- Error Module ------------------------//
//						  v 05 . 03 .  2007						 //
//																 //
//								MT								 //
//---------------------------------------------------------------//


#include "stdlib.h"


 class CError {
		int number;
		char *last_error_text;

	public : 
		CError() { number = -1; };
		~CError() { free(last_error_text); };
		CError(char *s, int num) { OnError(s, num); };

		void OnError(char *s, int num); 
 };


//----------------- Errors Defines -----------------
  // Socket errors
#define ERROR_SOCKET_CREATE "Error: Cann't create socket.", -2
#define ERROR_SOCKET_WRONG_IP "Error: Wrong remote IP or PORT.", -3
#define ERROR_SOCKET_OPEN_HOST "Error: Cann't open remote host.", -4

 // Others 
#define ERROR_INCORRECT_INPUT "Error: Incorrect input", -1000

//==================================================

#endif
