diff --git a/CHANGELOG.md b/CHANGELOG.md index e337e548cee..7312641c81a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -666,7 +666,7 @@ Released with 1.0.0-beta.37 code base. ### Fixed - Improved the error propagation in `web3-providers-http` package to effectively propagate useful error infomation about failed HTTP connections (#5955) - + - Fix error: "n.data.substring is not a function", that is raised when there is a revert and `web.eth.handleRevert = true` (#6000) ### Changed - `transaction.type` is now formatted to a hex string before being send to provider (#5979) diff --git a/packages/web3-core-method/src/index.js b/packages/web3-core-method/src/index.js index 53646183321..7747460b2cf 100644 --- a/packages/web3-core-method/src/index.js +++ b/packages/web3-core-method/src/index.js @@ -653,7 +653,7 @@ Method.prototype.buildCall = function () { if (!err && method.isRevertReasonString(result)){ reasonData = result.substring(10); } else if (err && err.data){ - reasonData = err.data.substring(10); + reasonData = (err.data.data || err.data).substring(10); } if (reasonData){