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

Function createUnknownSendMessageError

src/node/services/utils/sendMessageError.ts:31–40  ·  view source on GitHub ↗
(raw: string)

Source from the content-addressed store, hash-verified

29 * Enforces that the raw string is non-empty for defensive debugging.
30 */
31export const createUnknownSendMessageError = (raw: string): SendMessageError => {
32 assert(typeof raw === "string", "Expected raw error to be a string");
33 const trimmed = stripNoisyErrorPrefix(raw.trim());
34 assert(trimmed.length > 0, "createUnknownSendMessageError requires a non-empty message");
35
36 return {
37 type: "unknown",
38 raw: trimmed,
39 };
40};
41
42/**
43 * Formats a SendMessageError into a user-visible message and StreamErrorType

Callers 4

sendMessageMethod · 0.90
streamWithHistoryMethod · 0.90
notifyMethod · 0.90

Calls 2

stripNoisyErrorPrefixFunction · 0.85
assertFunction · 0.50

Tested by

no test coverage detected