#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub enum PgError {
Configuration,
AmbientConfiguration,
Registration,
Initialization,
StartupTimeout,
Cancelled,
}
impl std::fmt::Display for PgError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(match self {
Self::Configuration => "invalid managed PostgreSQL configuration",
Self::AmbientConfiguration => {
"ambient PG settings are not supported by managed PostgreSQL"
}
Self::Registration => "managed PostgreSQL registration rejected",
Self::Initialization => "managed PostgreSQL initialization failed",
Self::StartupTimeout => "managed PostgreSQL startup allowance expired",
Self::Cancelled => "managed PostgreSQL startup cancelled",
})
}
}
impl std::error::Error for PgError {}