From 2574e1e315c53f2389d2b3af007ca6da68c361e0 Mon Sep 17 00:00:00 2001 From: xfy Date: Wed, 10 Jun 2026 13:21:37 +0800 Subject: [PATCH] fix(api): gate AppError helper methods behind server feature tracing is an optional dependency unavailable in WASM builds. The constructors are only called from server-side code anyway. --- src/api/error.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/api/error.rs b/src/api/error.rs index 1c8ccb2..0c87758 100644 --- a/src/api/error.rs +++ b/src/api/error.rs @@ -11,6 +11,7 @@ pub enum AppError { Internal(&'static str), } +#[cfg(feature = "server")] impl AppError { pub fn db_conn(e: impl std::fmt::Display) -> Self { tracing::error!("DB connection failed: {e}");