Made MTTError a proper Error structure.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s

This commit is contained in:
2026-02-12 22:49:19 -05:00
parent 7ff9ca340f
commit a9b87200ef
12 changed files with 156 additions and 164 deletions

View File

@@ -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,
};
}