MCPcopy Create free account
hub / github.com/donghaxkim/react-rewrite / extractErrorCode

Function extractErrorCode

packages/cli/src/server.ts:63–69  ·  view source on GitHub ↗
(err: unknown)

Source from the content-addressed store, hash-verified

61 const queue: Array<{ msg: ClientMessage; ws: WebSocket }> = [];
62
63 function extractErrorCode(err: unknown): TransformErrorCode | undefined {
64 if (err instanceof Error) {
65 const match = err.message.match(/^(DYNAMIC_CLASSNAME|FILE_CHANGED|MAPPED_ELEMENT|CONFLICTING_CLASS)/);
66 if (match) return match[1] as TransformErrorCode;
67 }
68 return undefined;
69 }
70
71 function send(ws: WebSocket, msg: ServerMessage) {
72 if (ws.readyState === WebSocket.OPEN) {

Callers 1

processQueueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected