diff --git a/src/routes/insurance.ts b/src/routes/insurance.ts index 340be0d..e41eb16 100644 --- a/src/routes/insurance.ts +++ b/src/routes/insurance.ts @@ -80,7 +80,7 @@ export function insuranceRoutes(): Hono { logger.error("Error fetching insurance data", { slab, error: truncateErrorMessage(err instanceof Error ? err.message : String(err), 120) }); return c.json({ error: "Failed to fetch insurance data", - ...(process.env.NODE_ENV !== "production" && { details: err instanceof Error ? err.message : String(err) }) + ...(process.env.NODE_ENV !== "production" && { details: truncateErrorMessage(err instanceof Error ? err.message : String(err), 200) }) }, 500); } }); diff --git a/src/routes/open-interest.ts b/src/routes/open-interest.ts index e0bbd91..2dfc4eb 100644 --- a/src/routes/open-interest.ts +++ b/src/routes/open-interest.ts @@ -112,7 +112,7 @@ export function openInterestRoutes(): Hono { logger.error("Error fetching OI data", { slab, error: truncateErrorMessage(err instanceof Error ? err.message : String(err), 120) }); return c.json({ error: "Failed to fetch open interest data", - ...(process.env.NODE_ENV !== "production" && { details: err instanceof Error ? err.message : String(err) }) + ...(process.env.NODE_ENV !== "production" && { details: truncateErrorMessage(err instanceof Error ? err.message : String(err), 200) }) }, 500); } }); diff --git a/src/routes/stats.ts b/src/routes/stats.ts index aaee4fc..8c971a9 100644 --- a/src/routes/stats.ts +++ b/src/routes/stats.ts @@ -91,7 +91,7 @@ export function statsRoutes(): Hono { logger.error("Error fetching platform stats", { error: truncateErrorMessage(err instanceof Error ? err.message : String(err), 120) }); return c.json({ error: "Failed to fetch platform statistics", - ...(process.env.NODE_ENV !== "production" && { details: err instanceof Error ? err.message : String(err) }) + ...(process.env.NODE_ENV !== "production" && { details: truncateErrorMessage(err instanceof Error ? err.message : String(err), 200) }) }, 500); } });