31 #ifndef CPL_ERROR_H_INCLUDED
32 #define CPL_ERROR_H_INCLUDED
65 #ifdef STRICT_CPLERRORNUM_TYPE
100 #define CPLE_AppDefined 1
102 #define CPLE_OutOfMemory 2
104 #define CPLE_FileIO 3
106 #define CPLE_OpenFailed 4
108 #define CPLE_IllegalArg 5
110 #define CPLE_NotSupported 6
112 #define CPLE_AssertionFailed 7
114 #define CPLE_NoWriteAccess 8
116 #define CPLE_UserInterrupt 9
118 #define CPLE_ObjectNull 10
124 #define CPLE_HttpResponse 11
126 #define CPLE_AWSBucketNotFound 12
128 #define CPLE_AWSObjectNotFound 13
130 #define CPLE_AWSAccessDenied 14
132 #define CPLE_AWSInvalidCredentials 15
134 #define CPLE_AWSSignatureDoesNotMatch 16
148 void CPL_DLL
CPLErrorSetState( CPLErr eErrClass, CPLErrorNum err_no, const
char* pszMsg );
150 void CPL_DLL CPLCleanupErrorMutex(
void );
168 #ifdef WITHOUT_CPLDEBUG
169 #define CPLDebug(...)
171 void CPL_DLL CPL_STDCALL CPLDebug(
const char *,
CPL_FORMAT_STRING(
const char *), ...)
175 void CPL_DLL CPL_STDCALL
_CPLAssert(
const char *,
const char *,
int ) CPL_NO_RETURN;
179 # define CPLAssert(expr) ((expr) ? (void)(0) : _CPLAssert(#expr,__FILE__,__LINE__))
182 # define CPLAssert(expr)
192 # define VALIDATE_POINTER_ERR CE_Fatal
194 # define VALIDATE_POINTER_ERR CE_Failure
199 #define VALIDATE_POINTER0(ptr, func) \
200 do { if( NULL == ptr ) \
202 CPLErr const ret = VALIDATE_POINTER_ERR; \
203 CPLError( ret, CPLE_ObjectNull, \
204 "Pointer \'%s\' is NULL in \'%s\'.\n", #ptr, (func)); \
208 #define VALIDATE_POINTER1(ptr, func, rc) \
209 do { if( NULL == ptr ) \
211 CPLErr const ret = VALIDATE_POINTER_ERR; \
212 CPLError( ret, CPLE_ObjectNull, \
213 "Pointer \'%s\' is NULL in \'%s\'.\n", #ptr, (func)); \
214 return (rc); }} while(0)
#define CPLE_FileIO
Definition: cpl_error.h:104
#define CPLE_AppDefined
Definition: cpl_error.h:100
void CPL_DLL CPLEmergencyError(const char *) CPL_NO_RETURN
Definition: cpl_error.cpp:401
#define CPLE_AWSBucketNotFound
Definition: cpl_error.h:126
void CPL_DLL CPL_STDCALL CPLLoggingErrorHandler(CPLErr, CPLErrorNum, const char *)
Definition: cpl_error.cpp:881
CPLErr CPL_DLL CPL_STDCALL CPLGetLastErrorType(void)
Definition: cpl_error.cpp:764
void CPL_DLL CPL_STDCALL void CPL_DLL CPL_STDCALL _CPLAssert(const char *, const char *, int) CPL_NO_RETURN
Definition: cpl_error.cpp:1217
void CPL_DLL CPL_STDCALL CPLPushErrorHandler(CPLErrorHandler)
Definition: cpl_error.cpp:1087
void CPLTurnFailureIntoWarning(int bOn)
Definition: cpl_error.cpp:957
const char CPL_DLL *CPL_STDCALL CPLGetLastErrorMsg(void)
Definition: cpl_error.cpp:788
#define CPLE_OpenFailed
Definition: cpl_error.h:106
#define CPLE_NoWriteAccess
Definition: cpl_error.h:114
void CPL_DLL *CPL_STDCALL CPLGetErrorHandlerUserData(void)
Definition: cpl_error.cpp:169
#define CPLE_ObjectNull
Definition: cpl_error.h:118
CPLErrorHandler CPL_DLL CPL_STDCALL CPLSetErrorHandler(CPLErrorHandler)
Definition: cpl_error.cpp:1066
#define CPLE_UserInterrupt
Definition: cpl_error.h:116
#define CPL_PRINT_FUNC_FORMAT(format_idx, arg_idx)
Definition: cpl_port.h:967
#define CPL_NO_RETURN
Definition: cpl_port.h:1016
#define CPLE_HttpResponse
Definition: cpl_error.h:124
CPLErrorNum CPL_DLL CPL_STDCALL CPLGetLastErrorNo(void)
Definition: cpl_error.cpp:740
CPLErrorHandler CPL_DLL CPL_STDCALL CPLSetErrorHandlerEx(CPLErrorHandler, void *)
Definition: cpl_error.cpp:989
#define CPLE_AWSSignatureDoesNotMatch
Definition: cpl_error.h:134
#define CPLE_OutOfMemory
Definition: cpl_error.h:102
#define CPLE_NotSupported
Definition: cpl_error.h:110
void(CPL_STDCALL * CPLErrorHandler)(CPLErr, CPLErrorNum, const char *)
Definition: cpl_error.h:154
#define CPLE_AWSAccessDenied
Definition: cpl_error.h:130
#define CPLE_AWSObjectNotFound
Definition: cpl_error.h:128
void CPL_DLL CPL_STDCALL CPLSetCurrentErrorHandlerCatchDebug(int bCatchDebug)
Definition: cpl_error.cpp:1183
#define CPLE_AWSInvalidCredentials
Definition: cpl_error.h:132
void CPL_DLL CPL_STDCALL CPLQuietErrorHandler(CPLErr, CPLErrorNum, const char *)
Definition: cpl_error.cpp:866
int CPLErrorNum
Definition: cpl_error.h:95
void CPL_DLL CPL_STDCALL CPLPushErrorHandlerEx(CPLErrorHandler, void *)
Definition: cpl_error.cpp:1110
void CPL_DLL CPL_STDCALL CPLErrorReset(void)
Definition: cpl_error.cpp:653
#define CPLE_AssertionFailed
Definition: cpl_error.h:112
#define CPL_FORMAT_STRING(arg)
Definition: cpl_port.h:989
void CPL_DLL CPLErrorSetState(CPLErr eErrClass, CPLErrorNum err_no, const char *pszMsg)
Definition: cpl_error.cpp:687
void CPL_DLL void CPL_DLL CPLErrorV(CPLErr, CPLErrorNum, const char *, va_list)
Definition: cpl_error.cpp:231
void CPL_DLL CPL_STDCALL CPLPopErrorHandler(void)
Definition: cpl_error.cpp:1144
#define CPLE_None
Definition: cpl_error.h:98
void CPL_DLL CPL_STDCALL CPLDefaultErrorHandler(CPLErr, CPLErrorNum, const char *)
Definition: cpl_error.cpp:802
CPLErr
Definition: cpl_error.h:52
#define CPLE_IllegalArg
Definition: cpl_error.h:108