picodata_rust/error.rs
1use std::io;
2
3/// Picodata error.
4#[derive(thiserror::Error, Debug)]
5pub enum Error {
6 #[error("manager has been closed")]
7 Closed,
8 /// Address could not be parsed from returned row.
9 #[error("instance address is invalid: {0}")]
10 InvalidAddress(String),
11 /// Port could not be parsed from returned row.
12 #[error("instance port is invalid")]
13 InvalidPort,
14 /// Any error happened within tokio postgres.
15 #[error("postgres protocol error: {0}")]
16 Postgres(#[from] pg::Error),
17 /// Any error happended within deadpool.
18 #[error("postgres pool error: {0}")]
19 PostgresPool(#[from] pgpool::PoolError),
20 /// Any error happened on I/O.
21 #[error("io error: {0}")]
22 IO(#[from] io::Error),
23}