Skip to content

Commit 41f1c6e

Browse files
author
Wenhua Zhang
committed
feat: catch ClassCastException instead of Exception
1 parent ad1e9d4 commit 41f1c6e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

framework/src/main/java/org/tron/core/services/jsonrpc/TronJsonRpcImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ public String getCall(CallArguments transactionCall, Object blockParamObj)
731731
if (paramMap.containsKey("blockNumber")) {
732732
try {
733733
blockNumOrTag = paramMap.get("blockNumber");
734-
} catch (Exception e) {
734+
} catch (ClassCastException e) {
735735
throw new JsonRpcInvalidRequestException(JSON_ERROR);
736736
}
737737

@@ -749,7 +749,7 @@ public String getCall(CallArguments transactionCall, Object blockParamObj)
749749
} else if (paramMap.containsKey("blockHash")) {
750750
try {
751751
blockNumOrTag = paramMap.get("blockHash");
752-
} catch (Exception e) {
752+
} catch (ClassCastException e) {
753753
throw new JsonRpcInvalidRequestException(JSON_ERROR);
754754
}
755755

0 commit comments

Comments
 (0)