src/backend/gpopt/gpdbwrappers.cpp
void
gpdb::GpdbEreportImpl
	(
	int xerrcode,
	int severitylevel,
	const char *xerrmsg,
	const char *xerrhint,
	const char *filename,
	int lineno,
	const char *funcname
	)
{
	GP_WRAP_START;
	{
		// We cannot use the ereport() macro here, because we want to pass on
		// the caller's filename and line number. This is essentially an
		// expanded version of ereport(). It will be caught by the
		// GP_WRAP_END, and propagated up as a C++ exception, to be
		// re-thrown as a Postgres error once we leave the C++ land.
		if (errstart(severitylevel, filename, lineno, funcname, TEXTDOMAIN))
			errfinish (errcode(xerrcode),
					   errmsg("%s", xerrmsg),
					   xerrhint ? errhint("%s", xerrhint) : 0);
	}
	GP_WRAP_END;
}
// Helper function to throw an error with errcode, message and hint, like you
// would with ereport(...) in the backend. This could be extended for other
// fields, but this is all we need at the moment.
Helper function to throw an error with errcode, message and hint, like you
would with ereport(...) in the backend. This could be extended for other
fields, but this is all we need at the moment.
Helper function to throw an error with errcode message and hint like you would with ereport ( ... ) in the backend . This could be extended for other fields but this is all we need at the moment .
void
gpdb::GpdbEreportImpl
	(
	int xerrcode,
	int severitylevel,
	const char *xerrmsg,
	const char *xerrhint,
	const char *filename,
	int lineno,
	const char *funcname
	)
{
	GP_WRAP_START;
	{
		if (errstart(severitylevel, filename, lineno, funcname, TEXTDOMAIN))
			errfinish (errcode(xerrcode),
					   errmsg("%s", xerrmsg),
					   xerrhint ? errhint("%s", xerrhint) : 0);
	}
	GP_WRAP_END;
}
void gpdb :: GpdbEreportImpl ( int xerrcode , int severitylevel , const char * xerrmsg , const char * xerrhint , const char * filename , int lineno , const char * funcname ) { GP_WRAP_START ; { if ( errstart ( severitylevel , filename , lineno , funcname , TEXTDOMAIN ) ) errfinish ( errcode ( xerrcode ) , errmsg ( " " , xerrmsg ) , xerrhint ? errhint ( " " , xerrhint ) : 0 ) ; } GP_WRAP_END ; }
Helper function to throw an error with errcode, message and hint, like you
would with ereport(...) in the backend.
Helper function to throw an error with errcode message and hint like you would with ereport ( ... ) in the backend .
// We cannot use the ereport() macro here, because we want to pass on // the caller's filename and line number. This is essentially an // expanded version of ereport(). It will be caught by the // GP_WRAP_END, and propagated up as a C++ exception, to be // re-thrown as a Postgres error once we leave the C++ land.