initial working exn tracing

This commit is contained in:
2026-03-21 21:21:45 -04:00
parent ebe1836513
commit ddd6792205
4 changed files with 142 additions and 178 deletions

View File

@@ -1,3 +1,9 @@
mod db;
mod error;
mod exn_tracing;
use std::process::exit;
use derive_more::Display;
use exn::{Result, ResultExt, bail};
use serde::{Deserialize, Serialize};
@@ -6,10 +12,7 @@ use sqlx::prelude::FromRow;
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
use uuid::Uuid;
use crate::error::{ExnLayer, exn_to_json_value};
mod db;
mod error;
use crate::exn_tracing::{ExnLayer, exn_to_json_value};
#[derive(Debug, Clone, FromRow)]
pub struct FooBar {
@@ -38,8 +41,9 @@ async fn main() -> Result<(), MainError> {
let _ = match files::write().or_raise(err) {
Ok(_) => (),
Err(e) => {
tracing::error!(exn = %exn_to_json_value(&e));
bail!(MainError)
error_exn!(e);
exit(1);
//bail!(MainError)
}
};