diff options
| author | MohamedBassem <me@mbassem.com> | 2024-02-13 00:29:25 +0000 |
|---|---|---|
| committer | MohamedBassem <me@mbassem.com> | 2024-02-13 00:33:58 +0000 |
| commit | 33c9e8bca54d753c7ea976dd178db0cd5408c218 (patch) | |
| tree | 56099acd736a37845a7fce3a3ded0d399dbf5777 /packages/web/app/api | |
| parent | b00d2b360d8000edcd9bfa82673ca322a9ac6d1a (diff) | |
| download | karakeep-33c9e8bca54d753c7ea976dd178db0cd5408c218.tar.zst | |
feature: A usable, yet ugly browser extension
Diffstat (limited to 'packages/web/app/api')
| -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. |
