
// Auto-generated file -- do not edit

#include "Box.h"
#include "autogen_ServerException.h"

#include "MemLeakFindOn.h"

#ifdef EXCEPTION_CODENAMES_EXTENDED
	#ifdef EXCEPTION_CODENAMES_EXTENDED_WITH_DESCRIPTION
static const char *whats[] = {
	"Server Internal",
	"Server FailedToLoadConfiguration",
	"Server DaemoniseFailed",
	"Server AlreadyDaemonConstructed",
	"Server BadSocketHandle",
	"Server DupError",
	"UNUSED",
	"UNUSED",
	"Server SocketAlreadyOpen",
	"UNUSED",
	"Server SocketOpenError",
	"Server SocketPollError",
	"UNUSED",
	"Server SocketCloseError",
	"Server SocketNameUNIXPathTooLong",
	"UNUSED",
	"Server SocketBindError (Check the ListenAddresses directive in your config file -- must refer to local IP addresses only)",
	"Server SocketAcceptError",
	"Server ServerStreamBadListenAddrs",
	"Server ServerForkError",
	"Server ServerWaitOnChildError",
	"Server TooManySocketsInMultiListen (There is a limit on how many addresses you can listen on simulatiously.)",
	"Server ServerStreamTooManyListenAddresses",
	"Server TLSContextNotInitialised",
	"Server TLSAllocationFailed",
	"Server TLSLoadCertificatesFailed",
	"Server TLSLoadPrivateKeyFailed",
	"Server TLSLoadTrustedCAsFailed",
	"Server TLSSetCiphersFailed",
	"Server SSLLibraryInitialisationError",
	"UNUSED",
	"Server TLSNoSSLObject",
	"UNUSED",
	"UNUSED",
	"UNUSED",
	"Server TLSAlreadyHandshaked",
	"UNUSED",
	"UNUSED",
	"UNUSED",
	"UNUSED",
	"Server SocketSetNonBlockingFailed",
	"UNUSED",
	"UNUSED",
	"Server Protocol_BadUsage",
	"UNUSED",
	"UNUSED",
	"UNUSED",
	"UNUSED",
	"UNUSED",
	"UNUSED",
	"UNUSED",
	"Server Protocol_UnsuitableStreamTypeForSending",
	"UNUSED",
	"Server CantWriteToProtocolUncertainStream",
	"Server ProtocolUncertainStreamBadBlockHeader",
	"Server SocketPairFailed",
	"Server CouldNotChangePIDFileOwner",
	"Server SSLRandomInitFailed (Read from /dev/*random device failed)"
};
	#else
static const char *whats[] = {
	"Server Internal",
	"Server FailedToLoadConfiguration",
	"Server DaemoniseFailed",
	"Server AlreadyDaemonConstructed",
	"Server BadSocketHandle",
	"Server DupError",
	"UNUSED",
	"UNUSED",
	"Server SocketAlreadyOpen",
	"UNUSED",
	"Server SocketOpenError",
	"Server SocketPollError",
	"UNUSED",
	"Server SocketCloseError",
	"Server SocketNameUNIXPathTooLong",
	"UNUSED",
	"Server SocketBindError",
	"Server SocketAcceptError",
	"Server ServerStreamBadListenAddrs",
	"Server ServerForkError",
	"Server ServerWaitOnChildError",
	"Server TooManySocketsInMultiListen",
	"Server ServerStreamTooManyListenAddresses",
	"Server TLSContextNotInitialised",
	"Server TLSAllocationFailed",
	"Server TLSLoadCertificatesFailed",
	"Server TLSLoadPrivateKeyFailed",
	"Server TLSLoadTrustedCAsFailed",
	"Server TLSSetCiphersFailed",
	"Server SSLLibraryInitialisationError",
	"UNUSED",
	"Server TLSNoSSLObject",
	"UNUSED",
	"UNUSED",
	"UNUSED",
	"Server TLSAlreadyHandshaked",
	"UNUSED",
	"UNUSED",
	"UNUSED",
	"UNUSED",
	"Server SocketSetNonBlockingFailed",
	"UNUSED",
	"UNUSED",
	"Server Protocol_BadUsage",
	"UNUSED",
	"UNUSED",
	"UNUSED",
	"UNUSED",
	"UNUSED",
	"UNUSED",
	"UNUSED",
	"Server Protocol_UnsuitableStreamTypeForSending",
	"UNUSED",
	"Server CantWriteToProtocolUncertainStream",
	"Server ProtocolUncertainStreamBadBlockHeader",
	"Server SocketPairFailed",
	"Server CouldNotChangePIDFileOwner",
	"Server SSLRandomInitFailed"
};
	#endif
#endif

unsigned int ServerException::GetType() const throw()
{
	return ServerException::ExceptionType;
}

unsigned int ServerException::GetSubType() const throw()
{
	return mSubType;
}

const char *ServerException::what() const throw()
{
#ifdef EXCEPTION_CODENAMES_EXTENDED
	if(mSubType < 0 || mSubType > (sizeof(whats) / sizeof(whats[0])))
	{
		return "Server";
	}
	return whats[mSubType];
#else
	return "Server";
#endif
}

