From d80b60e2b12d173e181cf1c2b9e3f1e9214a3967 Mon Sep 17 00:00:00 2001 From: n4ze3m Date: Tue, 15 Oct 2024 19:13:25 +0530 Subject: [PATCH] Fix: More informative error messages in playground Improved error messages in the playground to provide more specific feedback to the user when encountering issues. This makes it easier to understand the reason for the error and potentially resolve the problem. --- server/src/handlers/api/v1/bot/playground/chat.handler.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/server/src/handlers/api/v1/bot/playground/chat.handler.ts b/server/src/handlers/api/v1/bot/playground/chat.handler.ts index c195aba..a225012 100644 --- a/server/src/handlers/api/v1/bot/playground/chat.handler.ts +++ b/server/src/handlers/api/v1/bot/playground/chat.handler.ts @@ -195,7 +195,7 @@ export const chatRequestStreamHandler = async ( return handleErrorResponse( history, message, - "There was an error processing your request." + "No embedding model found" ); } @@ -217,7 +217,7 @@ export const chatRequestStreamHandler = async ( return handleErrorResponse( history, message, - "There was an error processing your request." + "Not model found" ); } @@ -288,11 +288,10 @@ export const chatRequestStreamHandler = async ( await nextTick(); return reply.raw.end(); } catch (e) { - console.error(e); return handleErrorResponse( history, message, - "There was an error processing your request." + "Internal Server Error" ); } };