MCPcopy Create free account
hub / github.com/apache/cloudberry / GpdbEreportImpl

Method GpdbEreportImpl

src/backend/gpopt/gpdbwrappers.cpp:1514–1538  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

1512// would with ereport(...) in the backend. This could be extended for other
1513// fields, but this is all we need at the moment.
1514void
1515gpdb::GpdbEreportImpl(int xerrcode, int severitylevel, const char *xerrmsg,
1516 const char *xerrhint, const char *filename, int lineno,
1517 const char *funcname)
1518{
1519 GP_WRAP_START;
1520 {
1521 // We cannot use the ereport() macro here, because we want to pass on
1522 // the caller's filename and line number. This is essentially an
1523 // expanded version of ereport(). It will be caught by the
1524 // GP_WRAP_END, and propagated up as a C++ exception, to be
1525 // re-thrown as a Postgres error once we leave the C++ land.
1526 if (errstart(severitylevel, TEXTDOMAIN))
1527 {
1528 errcode(xerrcode);
1529 errmsg("%s", xerrmsg);
1530 if (xerrhint)
1531 {
1532 errhint("%s", xerrhint);
1533 }
1534 errfinish(filename, lineno, funcname);
1535 }
1536 }
1537 GP_WRAP_END;
1538}
1539
1540char *
1541gpdb::NodeToString(void *obj)

Callers

nothing calls this directly

Calls 5

errstartFunction · 0.50
errcodeFunction · 0.50
errmsgFunction · 0.50
errhintFunction · 0.50
errfinishFunction · 0.50

Tested by

no test coverage detected