Skip to content

Commit

Permalink
Fix: More informative error messages in playground
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
n4ze3m committed Oct 15, 2024
1 parent cd796bc commit d80b60e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions server/src/handlers/api/v1/bot/playground/chat.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export const chatRequestStreamHandler = async (
return handleErrorResponse(
history,
message,
"There was an error processing your request."
"No embedding model found"
);
}

Expand All @@ -217,7 +217,7 @@ export const chatRequestStreamHandler = async (
return handleErrorResponse(
history,
message,
"There was an error processing your request."
"Not model found"
);
}

Expand Down Expand Up @@ -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"
);
}
};

0 comments on commit d80b60e

Please sign in to comment.