pub type Result<T> = std::result::Result<T, Error>;
#[derive(thiserror::Error, Debug, Clone, PartialEq)]
pub enum Error {
#[error("Invalid PostgreSQL binaries download URL.")]
InvalidPgUrl,
#[error("Invalid PostgreSQL binaries package.")]
InvalidPgPackage,
#[error("Could not write to file: {0}")]
WriteFileError(String),
#[error("Could not read file: {0}")]
ReadFileError(String),
#[error("Could not create directory: {0}")]
DirCreationError(String),
#[error("Failed to unpack PostgreSQL binaries.")]
UnpackFailure,
#[error("PostgreSQL could not be started.")]
PgStartFailure,
#[error("PostgreSQL could not be stopped.")]
PgStopFailure,
#[error("PostgreSQL could not be initialized.")]
PgInitFailure,
#[error("Clean up error: {0}")]
PgCleanUpFailure(String),
#[error("Purging error: {0}")]
PgPurgeFailure(String),
#[error("Buffer read error.")]
PgBufferReadError,
#[error("Lock error.")]
PgLockError,
#[error("Child process error.")]
PgProcessError,
#[error("Operation timed out.")]
PgTimedOutError,
#[error("Task join error: {0}")]
PgTaskJoinError(String),
#[error("PgError: {0}, {1}")]
PgError(String, String),
#[error("PostgreSQL binaries download failure: {0}")]
DownloadFailure(String),
#[error("Request response bytes conversion failure: {0}")]
ConversionFailure(String),
#[error("Channel send error.")]
SendFailure,
#[error("SQLx query error: {0}")]
SqlQueryError(String),
#[error("Migration error: {0}")]
MigrationError(String),
}