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

Function getErrorCode

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

Source from the content-addressed store, hash-verified

19}
20
21function getErrorCode(error: unknown): string | undefined {
22 if (!error || typeof error !== "object") {
23 return undefined;
24 }
25
26 if ("code" in error && typeof error.code === "string") {
27 return error.code;
28 }
29
30 return undefined;
31}
32
33export function isIgnorableStreamError(error: unknown): boolean {
34 const code = getErrorCode(error);

Callers 2

isIgnorableStreamErrorFunction · 0.70
handlerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected