Moved to better error handling system
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use axum::{extract::State, Json};
|
||||
use axum::{
|
||||
extract::{FromRef, State},
|
||||
Json,
|
||||
};
|
||||
use itertools::Itertools;
|
||||
use sqlx::PgPool;
|
||||
|
||||
@@ -53,10 +56,13 @@ pub async fn migrate_confirm<'a>(
|
||||
|
||||
tracing::info!("Migration is confirmed");
|
||||
|
||||
// TODO: Implement better error naming
|
||||
let count = match body.trim().parse::<u32>() {
|
||||
Ok(c) => c,
|
||||
Err(_) => return Err(crate::Error::NotFound),
|
||||
Err(_) => {
|
||||
return Err(crate::Error::BadRequest {
|
||||
expected: String::from("u32"),
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
let mut store = state.migration_store.lock().await;
|
||||
|
Reference in New Issue
Block a user