Skip to content

Commit

Permalink
Store error message into constant
Browse files Browse the repository at this point in the history
  • Loading branch information
pH-7 committed May 7, 2024
1 parent a04ae52 commit bf49a7d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 1 addition & 4 deletions client/modules/engine-niche/gossip.textGeneration.engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,7 @@ export namespace Gossip {
} catch (error) {
console.error("Error while generating response with wllama:", error);

toast.error(
"Could not generate response. The browser may be out of memory. Please close this tab and run this search again in a new one.",
{ duration: 10000 },
);
toast.error(messages.cannotGenerateResponse, { duration: 5000 });
} finally {
dismissLoadingToast();
}
Expand Down
2 changes: 2 additions & 0 deletions client/modules/engine-niche/messages.constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const messages = {
researchReturnedNothing:
"Oops! Current search did't return any results. Try refining your search",
cannotGenerateResponse:
"A response couldn't be generated. Your Web browser may be out of memory. Try closing the tab and run it again in a new one.",
};

0 comments on commit bf49a7d

Please sign in to comment.