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.
This commit is contained in:
xfy 2026-06-10 13:21:37 +08:00
parent bf401e4916
commit 2574e1e315

View File

@ -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}");