diff options
Diffstat (limited to 'packages/web/app')
| -rw-r--r-- | packages/web/app/api/trpc/[trpc]/route.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/web/app/api/trpc/[trpc]/route.ts b/packages/web/app/api/trpc/[trpc]/route.ts index e04539a9..aea9bc70 100644 --- a/packages/web/app/api/trpc/[trpc]/route.ts +++ b/packages/web/app/api/trpc/[trpc]/route.ts @@ -8,6 +8,13 @@ const handler = (req: Request) => endpoint: "/api/trpc", req, router: appRouter, + onError: ({ path, error }) => { + if (process.env.NODE_ENV === "development") { + console.error(`❌ tRPC failed on ${path}`); + } + console.error(error); + }, + createContext: async (opts) => { // TODO: This is a hack until we offer a proper REST API instead of the trpc based one. // Check if the request has an Authorization token, if it does, assume that API key authentication is requested. |
