Skip to content

Commit

Permalink
Fix error: "n.data.substring is not a function" (#6000)
Browse files Browse the repository at this point in the history
* Fix error: "n.data.substring is not a function"

* update CHANGELOG.md
  • Loading branch information
Muhammad-Altabba committed Apr 11, 2023
1 parent 4e5afa1 commit 6ce085b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-core-method/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down

0 comments on commit 6ce085b

Please sign in to comment.