web3-core
Advanced tools
Comparing version 4.3.3-dev.f44dc5b.0 to 4.3.3-dev.f4e55bd.0
@@ -156,3 +156,3 @@ "use strict"; | ||
if (!(0, web3_utils_1.isNullish)(this.middleware)) { | ||
payload = (yield this.middleware.processRequest(payload)); | ||
payload = yield this.middleware.processRequest(payload); | ||
} | ||
@@ -182,6 +182,8 @@ if ((0, utils_js_1.isWeb3Provider)(provider)) { | ||
return new Promise((resolve, reject) => { | ||
const rejectWithError = (err) => reject(this._processJsonRpcResponse(payload, err, { | ||
legacy: true, | ||
error: true, | ||
})); | ||
const rejectWithError = (err) => { | ||
reject(this._processJsonRpcResponse(payload, err, { | ||
legacy: true, | ||
error: true, | ||
})); | ||
}; | ||
const resolveWithResponse = (response) => resolve(this._processJsonRpcResponse(payload, response, { | ||
@@ -208,3 +210,13 @@ legacy: true, | ||
const responsePromise = result; | ||
responsePromise.then(resolveWithResponse).catch(rejectWithError); | ||
responsePromise.then(resolveWithResponse).catch(error => { | ||
try { | ||
// Attempt to process the error response | ||
const processedError = this._processJsonRpcResponse(payload, error, { legacy: true, error: true }); | ||
reject(processedError); | ||
} | ||
catch (processingError) { | ||
// Catch any errors that occur during the error processing | ||
reject(processingError); | ||
} | ||
}); | ||
} | ||
@@ -211,0 +223,0 @@ }); |
@@ -150,3 +150,3 @@ /* | ||
if (!isNullish(this.middleware)) { | ||
payload = (yield this.middleware.processRequest(payload)); | ||
payload = yield this.middleware.processRequest(payload); | ||
} | ||
@@ -176,6 +176,8 @@ if (isWeb3Provider(provider)) { | ||
return new Promise((resolve, reject) => { | ||
const rejectWithError = (err) => reject(this._processJsonRpcResponse(payload, err, { | ||
legacy: true, | ||
error: true, | ||
})); | ||
const rejectWithError = (err) => { | ||
reject(this._processJsonRpcResponse(payload, err, { | ||
legacy: true, | ||
error: true, | ||
})); | ||
}; | ||
const resolveWithResponse = (response) => resolve(this._processJsonRpcResponse(payload, response, { | ||
@@ -202,3 +204,13 @@ legacy: true, | ||
const responsePromise = result; | ||
responsePromise.then(resolveWithResponse).catch(rejectWithError); | ||
responsePromise.then(resolveWithResponse).catch(error => { | ||
try { | ||
// Attempt to process the error response | ||
const processedError = this._processJsonRpcResponse(payload, error, { legacy: true, error: true }); | ||
reject(processedError); | ||
} | ||
catch (processingError) { | ||
// Catch any errors that occur during the error processing | ||
reject(processingError); | ||
} | ||
}); | ||
} | ||
@@ -205,0 +217,0 @@ }); |
{ | ||
"name": "web3-core", | ||
"version": "4.3.3-dev.f44dc5b.0+f44dc5b", | ||
"version": "4.3.3-dev.f4e55bd.0+f4e55bd", | ||
"description": "Web3 core tools for sub-packages. This is an internal package.", | ||
@@ -45,13 +45,13 @@ "main": "./lib/commonjs/index.js", | ||
"dependencies": { | ||
"web3-errors": "1.1.5-dev.f44dc5b.0+f44dc5b", | ||
"web3-eth-accounts": "4.1.3-dev.f44dc5b.0+f44dc5b", | ||
"web3-eth-iban": "4.0.8-dev.f44dc5b.0+f44dc5b", | ||
"web3-providers-http": "4.1.1-dev.f44dc5b.0+f44dc5b", | ||
"web3-providers-ws": "4.0.8-dev.f44dc5b.0+f44dc5b", | ||
"web3-types": "1.6.1-dev.f44dc5b.0+f44dc5b", | ||
"web3-utils": "4.2.4-dev.f44dc5b.0+f44dc5b", | ||
"web3-validator": "2.0.6-dev.f44dc5b.0+f44dc5b" | ||
"web3-errors": "1.1.5-dev.f4e55bd.0+f4e55bd", | ||
"web3-eth-accounts": "4.1.3-dev.f4e55bd.0+f4e55bd", | ||
"web3-eth-iban": "4.0.8-dev.f4e55bd.0+f4e55bd", | ||
"web3-providers-http": "4.1.1-dev.f4e55bd.0+f4e55bd", | ||
"web3-providers-ws": "4.0.8-dev.f4e55bd.0+f4e55bd", | ||
"web3-types": "1.6.1-dev.f4e55bd.0+f4e55bd", | ||
"web3-utils": "4.2.4-dev.f4e55bd.0+f4e55bd", | ||
"web3-validator": "2.0.6-dev.f4e55bd.0+f4e55bd" | ||
}, | ||
"optionalDependencies": { | ||
"web3-providers-ipc": "4.0.8-dev.f44dc5b.0+f44dc5b" | ||
"web3-providers-ipc": "4.0.8-dev.f4e55bd.0+f4e55bd" | ||
}, | ||
@@ -74,3 +74,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "f44dc5b6ad00648bff4abfc4339386ed6076275a" | ||
"gitHead": "f4e55bd30441b8e69c822d5ff1c6041291fd5a09" | ||
} |
@@ -213,3 +213,3 @@ /* | ||
if (!isNullish(this.middleware)) { | ||
payload = (await this.middleware.processRequest(payload)); | ||
payload = await this.middleware.processRequest(payload); | ||
} | ||
@@ -252,3 +252,3 @@ if (isWeb3Provider(provider)) { | ||
return new Promise<JsonRpcResponse<ResponseType>>((resolve, reject) => { | ||
const rejectWithError = (err: unknown) => | ||
const rejectWithError = (err: unknown) => { | ||
reject( | ||
@@ -264,2 +264,4 @@ this._processJsonRpcResponse( | ||
); | ||
}; | ||
const resolveWithResponse = (response: JsonRpcResponse<ResponseType>) => | ||
@@ -294,3 +296,16 @@ resolve( | ||
>; | ||
responsePromise.then(resolveWithResponse).catch(rejectWithError); | ||
responsePromise.then(resolveWithResponse).catch(error => { | ||
try { | ||
// Attempt to process the error response | ||
const processedError = this._processJsonRpcResponse( | ||
payload, | ||
error as JsonRpcResponse<ResponseType, unknown>, | ||
{ legacy: true, error: true }, | ||
); | ||
reject(processedError); | ||
} catch (processingError) { | ||
// Catch any errors that occur during the error processing | ||
reject(processingError); | ||
} | ||
}); | ||
} | ||
@@ -297,0 +312,0 @@ }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
482042
8489