Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(useTrpcError): ensure type safety (#10476)

marliessophie0ac87b92afda
diff --git a/web/src/hooks/useTrpcError.tsx b/web/src/hooks/useTrpcError.tsx
index 2e848d06ce..f1f2e8f061 100644
--- a/web/src/hooks/useTrpcError.tsx
+++ b/web/src/hooks/useTrpcError.tsx
@@ -7,6 +7,7 @@ export function useTrpcError(
return {
isSilentError:
error instanceof TRPCClientError &&
- silentHttpCodes.includes(error.data.httpStatus),
+ typeof error.data?.httpStatus === "number" &&
+ silentHttpCodes.includes(error.data?.httpStatus),
};
}