File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -23,5 +23,5 @@ public class RpcError
2323 /// Gets or sets additional data about the error.
2424 /// </summary>
2525 [ JsonProperty ( "data" ) ]
26- public string Data { get ; set ; }
26+ public object Data { get ; set ; }
2727}
Original file line number Diff line number Diff line change @@ -182,6 +182,7 @@ private async Task SendBatchAsync(List<RpcRequest> batch)
182182 }
183183
184184 var responseJson = await response . Content . ReadAsStringAsync ( ) . ConfigureAwait ( false ) ;
185+ Console . WriteLine ( responseJson ) ;
185186 var responses = JsonConvert . DeserializeObject < List < RpcResponse < object > > > ( responseJson ) ;
186187
187188 foreach ( var rpcResponse in responses )
@@ -197,12 +198,12 @@ private async Task SendBatchAsync(List<RpcRequest> batch)
197198 {
198199 try
199200 {
200- revertMsg = new Nethereum . ABI . FunctionEncoding . FunctionCallDecoder ( ) . DecodeFunctionErrorMessage ( rpcResponse . Error . Data ) ;
201- revertMsg = string . IsNullOrWhiteSpace ( revertMsg ) ? rpcResponse . Error . Data : revertMsg ;
201+ revertMsg = new Nethereum . ABI . FunctionEncoding . FunctionCallDecoder ( ) . DecodeFunctionErrorMessage ( rpcResponse . Error . Data . ToString ( ) ) ;
202+ revertMsg = string . IsNullOrWhiteSpace ( revertMsg ) ? rpcResponse . Error . Data . ToString ( ) : revertMsg ;
202203 }
203204 catch
204205 {
205- revertMsg = rpcResponse . Error . Data ;
206+ revertMsg = JsonConvert . SerializeObject ( rpcResponse . Error . Data ) ;
206207 }
207208 }
208209 tcs . SetException ( new Exception ( $ "RPC Error for request { rpcResponse . Id } : { rpcResponse . Error . Message } { revertMsg } ") ) ;
You can’t perform that action at this time.
0 commit comments