chenyc
2025-12-09 65e034683b28d799e73c7d7e5e4769fab5b9bc9c
1
2
3
4
5
6
7
const JSON_RPC_ERROR_CODES = { INTERNAL_ERROR: -32603, INVALID_PARAMS: -32602, METHOD_NOT_FOUND: -32601 };
const createErrorWithMessageAndStatus = (message, status) => Object.assign(new Error(message), { status });
export const renderMethodNotFoundError = (method) => createErrorWithMessageAndStatus(`The requested method called "${method}" is not supported.`, JSON_RPC_ERROR_CODES.METHOD_NOT_FOUND);
export const renderMissingResponseError = (method) => createErrorWithMessageAndStatus(`The handler of the method called "${method}" returned no required result.`, JSON_RPC_ERROR_CODES.INTERNAL_ERROR);
export const renderUnexpectedResultError = (method) => createErrorWithMessageAndStatus(`The handler of the method called "${method}" returned an unexpected result.`, JSON_RPC_ERROR_CODES.INTERNAL_ERROR);
export const renderUnknownPortIdError = (portId) => createErrorWithMessageAndStatus(`The specified parameter called "portId" with the given value "${portId}" does not identify a port connected to this worker.`, JSON_RPC_ERROR_CODES.INVALID_PARAMS);
//# sourceMappingURL=error-renderers.js.map