Struct pgrx_pg_sys::submodules::panic::ErrorReport
source · pub struct ErrorReport { /* private fields */ }
Expand description
Represents the set of information necessary for pgrx to promote a Rust panic!()
to a Postgres
ERROR
(or any PgLogLevel
level)
Implementations§
source§impl ErrorReport
impl ErrorReport
sourcepub fn new<S: Into<String>>(
sqlerrcode: PgSqlErrorCode,
message: S,
funcname: &'static str
) -> Self
pub fn new<S: Into<String>>( sqlerrcode: PgSqlErrorCode, message: S, funcname: &'static str ) -> Self
Create a [PgErrorReport] which can be raised via Rust’s std::panic::panic_any() or as a specific Postgres “ereport()` level via [PgErrorReport::report(self, PgLogLevel)]
Embedded “file:line:col” location information is taken from the caller’s location
sourcepub fn set_detail<S: Into<String>>(self, detail: S) -> Self
pub fn set_detail<S: Into<String>>(self, detail: S) -> Self
Set the detail
property, whose default is None
sourcepub fn set_hint<S: Into<String>>(self, hint: S) -> Self
pub fn set_hint<S: Into<String>>(self, hint: S) -> Self
Set the hint
property, whose default is None
sourcepub fn report(self, level: PgLogLevel)
pub fn report(self, level: PgLogLevel)
Report this [PgErrorReport], which will ultimately be reported by Postgres at the specified PgLogLevel
If the provided level
is >= PgLogLevel::ERROR
this function will not return.