File tree 2 files changed +13
-9
lines changed
2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -1881,12 +1881,15 @@ FlushErrorState(void)
1881
1881
/*
1882
1882
* ThrowErrorData --- report an error described by an ErrorData structure
1883
1883
*
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.
1890
1893
*/
1891
1894
void
1892
1895
ThrowErrorData (ErrorData * edata )
Original file line number Diff line number Diff line change 36
36
* After calling code that might report an error this way, check
37
37
* error_occurred to see if an error happened. If so, and if details_wanted
38
38
* 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.
42
43
*/
43
44
typedef struct ErrorSaveContext
44
45
{
You can’t perform that action at this time.
0 commit comments