pub struct Error(/* private fields */);Expand description
An error from giong-postgres.
Every error says what happened and, where there is one, what to do about
it. It is shown with the giong error code of its kind in front, and the
link to that code’s page at the end: GIONG-E3003: password authentication failed for user "app". See https://…/E3003.md.
kind tells errors apart in code; errors the server
reported carry its fields in db, with the SQLSTATE code in
code.
Errors are cheap to clone, and convert into std::io::Error, so ?
works in functions that return io::Result; there,
giong::error::code finds the code, and
giong::error::Error::get_ref gives this error back.
Implementations§
Source§impl Error
impl Error
Sourcepub fn conversion(message: impl Into<String>) -> Self
pub fn conversion(message: impl Into<String>) -> Self
Sourcepub fn giong_code(&self) -> Code
pub fn giong_code(&self) -> Code
Sourcepub fn db(&self) -> Option<&DbError>
pub fn db(&self) -> Option<&DbError>
The error the server reported, for ErrorKind::Db (and for
ErrorKind::Auth when the server refused the credentials).
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()