Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 6ce085b

Browse files
Fix error: "n.data.substring is not a function" (#6000)
* Fix error: "n.data.substring is not a function" * update CHANGELOG.md
1 parent 4e5afa1 commit 6ce085b

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ Released with 1.0.0-beta.37 code base.
666666
### Fixed
667667

668668
- Improved the error propagation in `web3-providers-http` package to effectively propagate useful error infomation about failed HTTP connections (#5955)
669-
669+
- Fix error: "n.data.substring is not a function", that is raised when there is a revert and `web.eth.handleRevert = true` (#6000)
670670
### Changed
671671

672672
- `transaction.type` is now formatted to a hex string before being send to provider (#5979)

packages/web3-core-method/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ Method.prototype.buildCall = function () {
653653
if (!err && method.isRevertReasonString(result)){
654654
reasonData = result.substring(10);
655655
} else if (err && err.data){
656-
reasonData = err.data.substring(10);
656+
reasonData = (err.data.data || err.data).substring(10);
657657
}
658658

659659
if (reasonData){

0 commit comments

Comments
 (0)