File tree 2 files changed +11
-8
lines changed
chainsql/src/main/java/com/peersafe/chainsql/contract 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -115,9 +115,12 @@ private List<Type> executeCall(
115
115
JSONObject objTx = prepareCallParam (function );
116
116
117
117
JSONObject ret = this .chainsql .connection .client .contractCall (objTx );
118
- if (ret .has ("error" )){
119
- throw new ContractCallException (ret .getString ("error" ));
118
+ if (ret .has ("error" ) && ret .has ("error_message" )){
119
+ throw new ContractCallException (ret .getString ("error" ),ret .getString ("error_message" ));
120
+ }else if (ret .has ("error" )){
121
+ throw new ContractCallException (ret .getString ("error" ));
120
122
}
123
+
121
124
return FunctionReturnDecoder .decode (ret .getString ("contract_call_result" ), function .getOutputParameters ());
122
125
}
123
126
Original file line number Diff line number Diff line change 4
4
* Exception resulting from issues calling methods on Smart Contracts.
5
5
*/
6
6
public class ContractCallException extends RuntimeException {
7
- public int error_code ;
8
- public ContractCallException (String message ) {
9
- super (message );
7
+ public String error ;
8
+ public ContractCallException (String error ) {
9
+ super (error );
10
10
}
11
- public ContractCallException (String message , int error_code ) {
12
- super (message );
13
- this .error_code = error_code ;
11
+ public ContractCallException (String error , String error_message ) {
12
+ super (error_message );
13
+ this .error = error ;
14
14
}
15
15
public ContractCallException (String message , Throwable cause ) {
16
16
super (message , cause );
You can’t perform that action at this time.
0 commit comments