mirror of
https://github.com/LeNei/axum-sqlx-template.git
synced 2026-02-13 22:56:19 +00:00
Base login setup
This commit is contained in:
23
src/models/mod.rs
Normal file
23
src/models/mod.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
pub mod user;
|
||||
|
||||
use axum::response::{IntoResponse, Redirect, Response};
|
||||
use tokio::task;
|
||||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum InertiaError {
|
||||
#[error(transparent)]
|
||||
Sqlx(#[from] sqlx::Error),
|
||||
|
||||
#[error(transparent)]
|
||||
TaskJoin(#[from] task::JoinError),
|
||||
|
||||
#[error("Something went wrong")]
|
||||
Unknown,
|
||||
}
|
||||
|
||||
impl IntoResponse for InertiaError {
|
||||
fn into_response(self) -> Response {
|
||||
tracing::error!("Error: {:?}", self);
|
||||
Redirect::to("/error").into_response()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user