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

Function handler

src/node/utils/streamErrors.ts:49–65  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

47 options: StreamErrorHandlerOptions = {}
48): () => void {
49 const handler = (error: unknown) => {
50 const normalized = normalizeError(error);
51 const info: StreamErrorInfo = {
52 label,
53 code: getErrorCode(error),
54 message: normalized.message,
55 };
56
57 if (isIgnorableStreamError(error)) {
58 options.logger?.debug("Ignored stream error", info, normalized);
59 options.onIgnorable?.(normalized, info);
60 return;
61 }
62
63 options.logger?.warn("Stream error", info, normalized);
64 options.onUnexpected?.(normalized, info);
65 };
66
67 emitter.on("error", handler);
68

Callers 8

finishFunction · 0.50
onStdoutMethod · 0.50
onStderrMethod · 0.50
onCloseMethod · 0.50
finishMethod · 0.50
getVscodeBridgeFunction · 0.50
expandSingleFunction · 0.50

Calls 4

normalizeErrorFunction · 0.85
isIgnorableStreamErrorFunction · 0.85
debugMethod · 0.80
getErrorCodeFunction · 0.70

Tested by

no test coverage detected