add error logging on server only

This commit is contained in:
Amruth Pillai
2026-02-08 01:16:38 +01:00
parent 5bdc6de862
commit 0a609306a6
3 changed files with 13 additions and 22 deletions
+6 -5
View File
@@ -1,3 +1,4 @@
import { onError } from "@orpc/server";
import { RPCHandler } from "@orpc/server/fetch";
import { BatchHandlerPlugin, RequestHeadersPlugin } from "@orpc/server/plugins";
import { createFileRoute } from "@tanstack/react-router";
@@ -5,11 +6,11 @@ import router from "@/integrations/orpc/router";
import { getLocale } from "@/utils/locale";
const rpcHandler = new RPCHandler(router, {
// interceptors: [
// onError((error) => {
// console.error(error);
// }),
// ],
interceptors: [
onError((error) => {
console.error(`ERROR [oRPC]: ${error}`);
}),
],
plugins: [new BatchHandlerPlugin(), new RequestHeadersPlugin()],
});