microlink
Version:
Comlink Alternative. Built with JSON-RPC.
39 lines (38 loc) • 575 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.InternalError = InternalError;
exports.MethodNotFound = MethodNotFound;
function InternalError({
error,
id
}) {
return {
jsonrpc: "2.0",
error: {
code: -32603,
message: "Internal error",
data: {
error: error.message
}
},
id
};
}
function MethodNotFound({
id,
method
}) {
return {
jsonrpc: "2.0",
error: {
code: -32601,
message: "Method not found",
data: {
method
}
},
id
};
}