File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -1881,12 +1881,15 @@ FlushErrorState(void)
18811881/*
18821882 * ThrowErrorData --- report an error described by an ErrorData structure
18831883 *
1884- * This is somewhat like ReThrowError, but it allows elevels besides ERROR,
1885- * and the boolean flags such as output_to_server are computed via the
1886- * default rules rather than being copied from the given ErrorData.
1887- * This is primarily used to re-report errors originally reported by
1888- * background worker processes and then propagated (with or without
1889- * modification) to the backend responsible for them.
1884+ * This function should be called on an ErrorData structure that isn't stored
1885+ * on the errordata stack and hasn't been processed yet. It will call
1886+ * errstart() and errfinish() as needed, so those should not have already been
1887+ * called.
1888+ *
1889+ * ThrowErrorData() is useful for handling soft errors. It's also useful for
1890+ * re-reporting errors originally reported by background worker processes and
1891+ * then propagated (with or without modification) to the backend responsible
1892+ * for them.
18901893 */
18911894void
18921895ThrowErrorData (ErrorData * edata )
Original file line number Diff line number Diff line change 3636 * After calling code that might report an error this way, check
3737 * error_occurred to see if an error happened. If so, and if details_wanted
3838 * is true, error_data has been filled with error details (stored in the
39- * callee's memory context!). FreeErrorData() can be called to release
40- * error_data, although that step is typically not necessary if the called
41- * code was run in a short-lived context.
39+ * callee's memory context!). The ErrorData can be modified (e.g. downgraded
40+ * to a WARNING) and reported with ThrowErrorData(). FreeErrorData() can be
41+ * called to release error_data, although that step is typically not necessary
42+ * if the called code was run in a short-lived context.
4243 */
4344typedef struct ErrorSaveContext
4445{
You can’t perform that action at this time.
0 commit comments