refactor and implement user

This commit is contained in:
2023-08-29 21:34:00 +02:00
parent 57f97b0b7d
commit efcac1edc0
9 changed files with 1509 additions and 1344 deletions

View File

@@ -47,6 +47,21 @@ pub enum StartError {
DatabaseMigrationError { message: String },
}
impl fmt::Display for StartError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Self::DatabaseInitError { message } => {
write!(f, "database initialization error: {message}")
}
Self::DatabaseMigrationError { message } => {
write!(f, "database migration error: {message}")
}
}
}
}
impl std::error::Error for StartError {}
impl From<sqlx::Error> for StartError {
fn from(value: sqlx::Error) -> Self {
Self::DatabaseInitError {