MCPcopy Create free account
hub / github.com/pollinations/pollinations / applyError

Function applyError

apps/chat/src/App.jsx:347–364  ·  view source on GitHub ↗
(error)

Source from the content-addressed store, hash-verified

345 : updatedChat.messages;
346
347 const applyError = (error) => {
348 if (error.message === "User aborted") {
349 updateMessage(assistantId, {
350 content: "**Message stopped by user**",
351 isStreaming: false,
352 isError: false,
353 });
354 } else {
355 updateMessage(assistantId, {
356 content: error.message,
357 isStreaming: false,
358 isError: true,
359 errorType: error.errorType || "unknown",
360 errorCode: error.code || null,
361 });
362 }
363 setIsGenerating(false);
364 };
365
366 try {
367 await sendMessage(

Callers 1

AppFunction · 0.85

Calls 1

updateMessageFunction · 0.85

Tested by

no test coverage detected