Package org.web3j.utils
Class RevertReasonExtractor
- java.lang.Object
-
- org.web3j.utils.RevertReasonExtractor
-
public class RevertReasonExtractor extends java.lang.Object
Revert reason extraction and retrieval functions.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
MISSING_REASON
-
Constructor Summary
Constructors Constructor Description RevertReasonExtractor()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
extractRevertReason(TransactionReceipt transactionReceipt, java.lang.String data, Web3j web3j, java.lang.Boolean revertReasonCallEnabled)
Extracts the error reason of a reverted transaction (if one exists and enabled).static java.lang.String
retrieveRevertReason(TransactionReceipt transactionReceipt, java.lang.String data, Web3j web3j)
Retrieves the error reason of a reverted transaction (if one exists).
-
-
-
Field Detail
-
MISSING_REASON
public static final java.lang.String MISSING_REASON
- See Also:
- Constant Field Values
-
-
Method Detail
-
extractRevertReason
public static java.lang.String extractRevertReason(TransactionReceipt transactionReceipt, java.lang.String data, Web3j web3j, java.lang.Boolean revertReasonCallEnabled) throws java.io.IOException
Extracts the error reason of a reverted transaction (if one exists and enabled).- Parameters:
transactionReceipt
- the reverted transaction receiptdata
- the reverted transaction dataweb3j
- Web3j instancerevertReasonCallEnabled
- flag of reason retrieval via additional call- Returns:
- the reverted transaction error reason if exists or null otherwise
- Throws:
java.io.IOException
- if the call to the node fails
-
retrieveRevertReason
public static java.lang.String retrieveRevertReason(TransactionReceipt transactionReceipt, java.lang.String data, Web3j web3j) throws java.io.IOException
Retrieves the error reason of a reverted transaction (if one exists).- Parameters:
transactionReceipt
- the reverted transaction receiptdata
- the reverted transaction dataweb3j
- Web3j instance- Returns:
- the reverted transaction error reason if exists or null otherwise
- Throws:
java.io.IOException
- if the call to the node fails
-
-