From 08e76edd517a9ebc36a93d6a35b9df3bf99f91af Mon Sep 17 00:00:00 2001 From: Ramnique Singh <30795890+ramnique@users.noreply.github.com> Date: Wed, 20 Aug 2025 00:54:11 +0530 Subject: [PATCH] remove user-facing errors --- .../app/api/copilot-stream-response/[streamId]/route.ts | 2 +- apps/rowboat/app/api/stream-response/[streamId]/route.ts | 2 +- apps/rowboat/app/api/v1/[projectId]/chat/route.ts | 2 +- apps/rowboat/app/scripts/rag-worker.ts | 4 ++-- .../src/application/lib/agents-runtime/agent-tools.ts | 8 ++++---- apps/rowboat/src/application/workers/jobs.worker.ts | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/rowboat/app/api/copilot-stream-response/[streamId]/route.ts b/apps/rowboat/app/api/copilot-stream-response/[streamId]/route.ts index 3b743a3a..1e540933 100644 --- a/apps/rowboat/app/api/copilot-stream-response/[streamId]/route.ts +++ b/apps/rowboat/app/api/copilot-stream-response/[streamId]/route.ts @@ -53,7 +53,7 @@ export async function GET(request: Request, props: { params: Promise<{ streamId: } } catch (error) { console.error('Error processing copilot stream:', error); - controller.error(error); + controller.error(new Error("Something went wrong. Please try again.")); } finally { // log copilot usage if (USE_BILLING && billingCustomerId) { diff --git a/apps/rowboat/app/api/stream-response/[streamId]/route.ts b/apps/rowboat/app/api/stream-response/[streamId]/route.ts index 4fc9de3f..17c1a8d8 100644 --- a/apps/rowboat/app/api/stream-response/[streamId]/route.ts +++ b/apps/rowboat/app/api/stream-response/[streamId]/route.ts @@ -31,7 +31,7 @@ export async function GET(request: Request, props: { params: Promise<{ streamId: console.error('Error processing stream:', error); const errMessage: z.infer = { type: "error", - error: `Error processing stream: ${error}`, + error: "Something went wrong. Please try again.", isBillingError: false, }; controller.enqueue(encoder.encode(`event: message\ndata: ${JSON.stringify(errMessage)}\n\n`)); diff --git a/apps/rowboat/app/api/v1/[projectId]/chat/route.ts b/apps/rowboat/app/api/v1/[projectId]/chat/route.ts index 73a48348..95234692 100644 --- a/apps/rowboat/app/api/v1/[projectId]/chat/route.ts +++ b/apps/rowboat/app/api/v1/[projectId]/chat/route.ts @@ -55,7 +55,7 @@ export async function POST( controller.close(); } catch (error) { logger.log(`Error processing stream: ${error}`); - controller.error(error); + controller.error(new Error("Something went wrong. Please try again.")); } }, }); diff --git a/apps/rowboat/app/scripts/rag-worker.ts b/apps/rowboat/app/scripts/rag-worker.ts index a0020b9c..3142a652 100644 --- a/apps/rowboat/app/scripts/rag-worker.ts +++ b/apps/rowboat/app/scripts/rag-worker.ts @@ -433,7 +433,7 @@ async function runDeletionPipeline(_logger: PrefixLogger, job: z.infer