Made MTTError a proper Error structure.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s
This commit is contained in:
@@ -8,7 +8,7 @@ use axum::{
|
||||
use clap::Parser;
|
||||
//use morethantext::{ActionType, ErrorType, MoreThanText};
|
||||
//use morethantext::{MoreThanText, MsgAction, Query};
|
||||
use morethantext::{MTTError, MoreThanText};
|
||||
use morethantext::{ErrorID, MTTError, MoreThanText};
|
||||
use std::{collections::HashMap, convert::Infallible};
|
||||
use tokio::{spawn, sync::mpsc::channel};
|
||||
use tower_cookies::{Cookie, CookieManagerLayer, Cookies};
|
||||
@@ -108,8 +108,8 @@ async fn mtt_conn(
|
||||
result = data.clone();
|
||||
}
|
||||
Err(err) => {
|
||||
status = match err {
|
||||
MTTError::DocumentNotFound(_) => StatusCode::NOT_FOUND,
|
||||
status = match err.error_id() {
|
||||
ErrorID::DocumentNotFound => StatusCode::NOT_FOUND,
|
||||
_ => StatusCode::INTERNAL_SERVER_ERROR,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user