
// Auto-generated file -- do not edit

#ifndef AUTOGEN_SERVEREXCEPTION_H
#define AUTOGEN_SERVEREXCEPTION_H

#include "BoxException.h"

// --------------------------------------------------------------------------
//
// Class
//		Name:    ServerException
//		Purpose: Exception
//		Created: autogen
//
// --------------------------------------------------------------------------
class ServerException : public BoxException
{
public:
	ServerException(unsigned int SubType,
		const std::string& rMessage = "")
	: mSubType(SubType), mMessage(rMessage)
	{
	}
	
	ServerException(const ServerException &rToCopy)
	: mSubType(rToCopy.mSubType), mMessage(rToCopy.mMessage)
	{
	}
	
	~ServerException() throw ()
	{
	}
	
	enum
	{
		ExceptionType = 3
	};

	enum
	{
		Internal = 0,
		FailedToLoadConfiguration = 1,
		DaemoniseFailed = 2,
		AlreadyDaemonConstructed = 3,
		BadSocketHandle = 4,
		DupError = 5,
		SocketAlreadyOpen = 8,
		SocketOpenError = 10,
		SocketPollError = 11,
		SocketCloseError = 13,
		SocketNameUNIXPathTooLong = 14,
		SocketBindError = 16,
		SocketAcceptError = 17,
		ServerStreamBadListenAddrs = 18,
		ServerForkError = 19,
		ServerWaitOnChildError = 20,
		TooManySocketsInMultiListen = 21,
		ServerStreamTooManyListenAddresses = 22,
		TLSContextNotInitialised = 23,
		TLSAllocationFailed = 24,
		TLSLoadCertificatesFailed = 25,
		TLSLoadPrivateKeyFailed = 26,
		TLSLoadTrustedCAsFailed = 27,
		TLSSetCiphersFailed = 28,
		SSLLibraryInitialisationError = 29,
		TLSNoSSLObject = 31,
		TLSAlreadyHandshaked = 35,
		SocketSetNonBlockingFailed = 40,
		Protocol_BadUsage = 43,
		Protocol_UnsuitableStreamTypeForSending = 51,
		CantWriteToProtocolUncertainStream = 53,
		ProtocolUncertainStreamBadBlockHeader = 54,
		SocketPairFailed = 55,
		CouldNotChangePIDFileOwner = 56,
		SSLRandomInitFailed = 57
	};
	
	virtual unsigned int GetType() const throw();
	virtual unsigned int GetSubType() const throw();
	virtual const char *what() const throw();
	virtual const std::string& GetMessage() const
	{
		return mMessage;
	}

private:
	unsigned int mSubType;
	std::string mMessage;
};

#endif // AUTOGEN_SERVEREXCEPTION_H
