diff --git a/package.json b/package.json index 4b774c8..9ff643f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fleekhq/browser-rpc", - "version": "2.0.2", + "version": "2.0.3", "main": "dist/index.js", "module": "dist/esm/index.js", "jsnext:main": "dist/esm/index.js", diff --git a/src/RPC.ts b/src/RPC.ts index cad9297..b961353 100644 --- a/src/RPC.ts +++ b/src/RPC.ts @@ -64,8 +64,6 @@ export default abstract class RPC { return new Promise((resolve, reject) => { const resolver: Resolver = (err, res) => { if (err) { - console.error(err); - reject(new Error(err.message)); return; } @@ -81,7 +79,7 @@ export default abstract class RPC { this.calls.delete(id); resolver({ - code: JSON_RPC_ERROR_CODES.INTERNAL_ERROR, + code: JSON_RPC_ERROR_CODES.TIMEOUT_ERROR, message: 'Request Timeout', }); } diff --git a/src/constants.ts b/src/constants.ts index bef3a67..91ccc8b 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -4,6 +4,7 @@ export const JSON_RPC_ERROR_CODES = { METHOD_NOT_FOUND: -32601, INVALID_PARAMS: -32602, INTERNAL_ERROR: -32603, + TIMEOUT_ERROR: -32604, SERVER_ERROR: -32000, };