#ifndef __DSLogException_h__
#define __DSLogException_h__ 1
#include <DirectoryServiceCore/PrivateTypes.h>
#define LogThenThrowIfDSErrorMacro( inDSError ) \
{ \
SInt32 aDSError = inDSError; \
if ( aDSError != eDSNoErr ) \
{ \
LOG3( kStdErr, "*** DS Error: File: %s. Line: %d. Error = %d\n", __FILE__, __LINE__, aDSError ); \
throw( aDSError ); \
} \
} if (true)
#define LogThenThrowIfTrueMacro( inCheck, inDSError ) \
{ \
SInt32 aDSError = inDSError; \
if ( inCheck ) \
{ \
LOG3( kStdErr, "*** DS If True Error: File: %s. Line: %d. Error = %d\n", __FILE__, __LINE__, aDSError ); \
throw( aDSError ); \
} \
} if (true)
#define LogThenThrowIfNilMacro( inPtr, inDSError ) \
{ \
SInt32 aDSError = inDSError; \
if ( inPtr == nil ) \
{ \
LOG3( kStdErr, "*** DS If nil Error: File: %s. Line: %d. Error = %d\n", __FILE__, __LINE__, aDSError ); \
throw( aDSError ); \
} \
} if (true)
#define LogThenThrowIfZeroMacro( inValue, inDSError ) \
{ \
SInt32 aDSError = inDSError; \
if ( inValue == 0 ) \
{ \
LOG3( kStdErr, "*** DS If zero Error: File: %s. Line: %d. Error = %d\n", __FILE__, __LINE__, aDSError ); \
throw( aDSError ); \
} \
} if (true)
#define LogThenThrowThisIfDSErrorMacro( inDSError, inThrowThisError ) \
{ \
SInt32 aDSError = inDSError; \
if ( aDSError != eDSNoErr ) \
{ \
LOG4( kStdErr, "*** DS Error: File: %s. Line: %d. Error = %d. Thrown Error = %d\n", __FILE__, __LINE__, aDSError, inThrowThisError ); \
throw( (SInt32)inThrowThisError ); \
} \
} if (true)
#endif // __DSLogException_h__