|
Cppgres
Build Postgres extensions in C++
|
Public Member Functions | |
| const char * | message () const noexcept |
| const ::ErrorData * | error_data () const noexcept |
| The complete error record captured from Postgres. | |
| void | rethrow () |
| Re-throws the captured error as a Postgres error, with every field (SQLSTATE, detail, hint, context, ...) intact. | |
Friends | |
| template<typename Func > | |
| struct | ffi_guard |
|
inlinenoexcept |
The complete error record captured from Postgres.
Valid for the lifetime of the exception object.
|
inline |
Re-throws the captured error as a Postgres error, with every field (SQLSTATE, detail, hint, context, ...) intact.
Intended to be called from a catch block once cleanup is done and the error should continue propagating to Postgres. Never returns.
The longjmp does not run this object's destructor, so the exception's backing storage is handed to Postgres to be released when ErrorContext is reset — that is, once the error has been fully handled.