mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-06-20 22:04:03 -06:00
59 lines
1.9 KiB
C++
59 lines
1.9 KiB
C++
|
|
#include "sdeerror.h"
|
|
|
|
/************************************************************************/
|
|
/* IssueSDEError() */
|
|
/* from ogrsdedatasource.cpp */
|
|
/************************************************************************/
|
|
|
|
void IssueSDEError( int nErrorCode,
|
|
const char *pszFunction )
|
|
|
|
{
|
|
char szErrorMsg[SE_MAX_MESSAGE_LENGTH+1];
|
|
|
|
if( pszFunction == NULL )
|
|
pszFunction = "SDERASTER";
|
|
|
|
SE_error_get_string( nErrorCode, szErrorMsg );
|
|
|
|
CPLError( CE_Failure, CPLE_AppDefined,
|
|
"%s: %d/%s",
|
|
pszFunction, nErrorCode, szErrorMsg );
|
|
}
|
|
|
|
/************************************************************************/
|
|
/* IssueSDEExtendedError() */
|
|
/************************************************************************/
|
|
void IssueSDEExtendedError ( int nErrorCode,
|
|
const char *pszFunction,
|
|
SE_CONNECTION* connection,
|
|
SE_STREAM* stream) {
|
|
|
|
SE_ERROR err;
|
|
char szErrorMsg[SE_MAX_MESSAGE_LENGTH+1];
|
|
|
|
if( pszFunction == NULL )
|
|
pszFunction = "SDERASTER";
|
|
|
|
SE_error_get_string( nErrorCode, szErrorMsg );
|
|
|
|
|
|
if (connection)
|
|
SE_connection_get_ext_error( *connection, &err );
|
|
if (stream)
|
|
SE_stream_get_ext_error( *stream, &err );
|
|
|
|
if (connection || stream) {
|
|
CPLError ( CE_Failure, CPLE_AppDefined,
|
|
"%s: %d/%s ---- %s ---- %s ---- %s ---- %s",
|
|
pszFunction, nErrorCode, szErrorMsg,
|
|
err.sde_error, err.ext_error,
|
|
err.err_msg1, err.err_msg2 );
|
|
|
|
} else {
|
|
CPLError ( CE_Failure, CPLE_AppDefined,
|
|
"%s: %d/%s",
|
|
pszFunction, nErrorCode, szErrorMsg );
|
|
}
|
|
}
|