remove user-facing errors

This commit is contained in:
Ramnique Singh 2025-08-20 00:54:11 +05:30
parent 7f04dc56bd
commit 08e76edd51
6 changed files with 10 additions and 10 deletions

View file

@ -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) {

View file

@ -31,7 +31,7 @@ export async function GET(request: Request, props: { params: Promise<{ streamId:
console.error('Error processing stream:', error);
const errMessage: z.infer<typeof TurnEvent> = {
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`));

View file

@ -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."));
}
},
});

View file

@ -433,7 +433,7 @@ async function runDeletionPipeline(_logger: PrefixLogger, job: z.infer<typeof Da
logger.log("Error processing doc:", e);
await dataSourceDocsRepository.updateByVersion(doc.id, doc.version, {
status: "error",
error: e.message,
error: "Error processing doc",
});
} finally {
// log usage in billing
@ -466,7 +466,7 @@ async function runDeletionPipeline(_logger: PrefixLogger, job: z.infer<typeof Da
logger.log("Error deleting doc:", e);
await dataSourceDocsRepository.updateByVersion(doc.id, doc.version, {
status: "error",
error: e.message,
error: "Error deleting doc",
});
}
}