MCPcopy
hub / github.com/coder/mux / buildStreamErrorEventData

Function buildStreamErrorEventData

src/node/services/utils/sendMessageError.ts:167–179  ·  view source on GitHub ↗
(
  error: SendMessageError,
  options?: { acpPromptId?: string }
)

Source from the content-addressed store, hash-verified

165 * Build a stream-error payload for pre-stream failures so the UI can surface them immediately.
166 */
167export const buildStreamErrorEventData = (
168 error: SendMessageError,
169 options?: { acpPromptId?: string }
170): StreamErrorPayload => {
171 const { message, errorType } = formatSendMessageError(error);
172 const messageId = createAssistantMessageId();
173 return {
174 messageId,
175 error: message,
176 errorType,
177 acpPromptId: options?.acpPromptId,
178 };
179};

Callers 4

streamWithHistoryMethod · 0.90

Calls 2

createAssistantMessageIdFunction · 0.90
formatSendMessageErrorFunction · 0.70

Tested by

no test coverage detected