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.
| 1512 | // would with ereport(...) in the backend. This could be extended for other |
| 1513 | // fields, but this is all we need at the moment. |
| 1514 | void |
| 1515 | gpdb::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 | |
| 1540 | char * |
| 1541 | gpdb::NodeToString(void *obj) |