MCPcopy Create free account
hub / github.com/OSGeo/gdal / CPLGetErrorHandler

Function CPLGetErrorHandler

port/cpl_error.cpp:175–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173 */
174
175CPLErrorHandler CPLGetErrorHandler(void **ppUserData)
176{
177 CPLErrorContext *psCtx = CPLGetErrorContext();
178
179 if (psCtx == nullptr || IS_PREFEFINED_ERROR_CTX(psCtx))
180 {
181 fprintf(stderr, "CPLGetErrorHandler() failed.\n");
182 if (ppUserData)
183 *ppUserData = nullptr;
184 return CPLDefaultErrorHandler;
185 }
186
187 if (psCtx->psHandlerStack != nullptr)
188 {
189 if (ppUserData)
190 *ppUserData = psCtx->psHandlerStack->pUserData;
191 return psCtx->psHandlerStack->pfnHandler;
192 }
193
194 CPLMutexHolderD(&hErrorMutex);
195 if (ppUserData)
196 *ppUserData = pErrorHandlerUserData;
197 return pfnErrorHandler;
198}
199
200/************************************************************************/
201/* ApplyErrorHandler() */

Callers

nothing calls this directly

Calls 1

CPLGetErrorContextFunction · 0.85

Tested by

no test coverage detected