(raw: string)
| 29 | * Enforces that the raw string is non-empty for defensive debugging. |
| 30 | */ |
| 31 | export 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 |
no test coverage detected