1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-19 13:42:17 +03:00

Improve ThrowErrorData() comments for use with soft errors.

Reviewed-by: Corey Huinker
Discussion: https://postgr.es/m/901ab7cf01957f92ea8b30b6feeb0eacfb7505fc.camel@j-davis.com
This commit is contained in:
Jeff Davis
2024-10-17 14:56:44 -07:00
parent 1fed234f9f
commit eecd9138a0
2 changed files with 13 additions and 9 deletions

View File

@@ -1881,12 +1881,15 @@ FlushErrorState(void)
/*
* ThrowErrorData --- report an error described by an ErrorData structure
*
* This is somewhat like ReThrowError, but it allows elevels besides ERROR,
* and the boolean flags such as output_to_server are computed via the
* default rules rather than being copied from the given ErrorData.
* This is primarily used to re-report errors originally reported by
* background worker processes and then propagated (with or without
* modification) to the backend responsible for them.
* This function should be called on an ErrorData structure that isn't stored
* on the errordata stack and hasn't been processed yet. It will call
* errstart() and errfinish() as needed, so those should not have already been
* called.
*
* ThrowErrorData() is useful for handling soft errors. It's also useful for
* re-reporting errors originally reported by background worker processes and
* then propagated (with or without modification) to the backend responsible
* for them.
*/
void
ThrowErrorData(ErrorData *edata)