* Map a thrown error to the right envelope. See module header for the table.
(
reply: { send(payload: unknown): unknown },
requestId: string,
err: unknown,
)
| 164 | * Map a thrown error to the right envelope. See module header for the table. |
| 165 | */ |
| 166 | function sendMappedError( |
| 167 | reply: { send(payload: unknown): unknown }, |
| 168 | requestId: string, |
| 169 | err: unknown, |
| 170 | ): void { |
| 171 | if (err instanceof McpServerNotFoundError) { |
| 172 | reply.send(errEnvelope(ErrorCode.MCP_SERVER_NOT_FOUND, err.message, requestId)); |
| 173 | return; |
| 174 | } |
| 175 | throw err; |
| 176 | } |
no test coverage detected