Skip to content

Commit 50d6995

Browse files
authored
fix rpc error (#894)
* fix rpc error * format
1 parent a2a9d4f commit 50d6995

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ApplicationLogs/LogReader.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,14 @@ protected override void OnSystemLoaded(NeoSystem system)
8787
public JToken GetApplicationLog(JArray _params)
8888
{
8989
if (_params == null || _params.Count == 0)
90-
throw new RpcException(-32602, "Invalid params");
90+
throw new RpcException(RpcError.InvalidParams);
9191
if (UInt256.TryParse(_params[0].AsString(), out var hash))
9292
{
9393
var raw = BlockToJObject(hash);
9494
if (raw == null)
9595
raw = TransactionToJObject(hash);
9696
if (raw == null)
97-
throw new RpcException(-100, "Unknown transaction/blockhash");
97+
throw new RpcException(RpcError.InvalidParams.WithData("Unknown transaction/blockhash"));
9898

9999
if (_params.Count >= 2 && Enum.TryParse(_params[1].AsString(), true, out TriggerType triggerType))
100100
{
@@ -111,7 +111,7 @@ public JToken GetApplicationLog(JArray _params)
111111
return raw ?? JToken.Null;
112112
}
113113
else
114-
throw new RpcException(-32602, "Invalid params");
114+
throw new RpcException(RpcError.InvalidParams);
115115
}
116116

117117
#endregion

0 commit comments

Comments
 (0)