Skip to main content

monoio_pg/
error.rs

1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum Error {
5    #[error("I/O error: {0}")]
6    Io(#[from] std::io::Error),
7
8    #[error("Postgres protocol error: {0}")]
9    Protocol(String),
10
11    #[error("Authentication failed: {0}")]
12    Authentication(String),
13
14    #[error("Parse error: {0}")]
15    Parse(String),
16
17    #[error("Connection closed")]
18    Closed,
19
20    #[error("Other error: {0}")]
21    Other(String),
22}
23
24pub type Result<T> = std::result::Result<T, Error>;