Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPC Server DebugMode #840

Closed
cschuchardt88 opened this issue Nov 11, 2023 · 4 comments
Closed

RPC Server DebugMode #840

cschuchardt88 opened this issue Nov 11, 2023 · 4 comments

Comments

@cschuchardt88
Copy link
Member

Summary or problem description
Hi guys, working on neo-express. Ran into a problem where I am trying to get an error from RPC server. We use a custom express plugin to do this. However we are still using the core of RPC Server with add-ons of custom methods.

the problem is:

catch (FormatException)
{
return CreateErrorResponse(request["id"], -32602, "Invalid params");
}
catch (IndexOutOfRangeException)
{
return CreateErrorResponse(request["id"], -32602, "Invalid params");
}
catch (Exception ex)
{
#if DEBUG
return CreateErrorResponse(request["id"], ex.HResult, ex.Message, ex.StackTrace);
#else
return CreateErrorResponse(request["id"], ex.HResult, ex.Message);
#endif
}

What the problem is, we are getting error Neo.Network.RPC.RpcException: Invalid params and I want to get the real error. Sure there is workarounds for this and I know this would make NeoGo node inconsistent with C# node.

Do you have any solution you want to propose?
That we have a setting in the config.json file to bypass this to show the full error.

{
  "DebugMode": "true"
}

Where in the software does this update applies to?

  • Plugins
  • RPC (HTTP)
@Jim8y
Copy link
Contributor

Jim8y commented Nov 11, 2023

make sense

@roman-khimov
Copy link
Contributor

I'd just implement #814 and that's it. Try the same requests for NeoGo nodes (https://status.fs.neo.org/ has some public ones), it returns much more data even for common "invalid params" codes (data field exists exactly for that). Nothing prevents C# node from doing the same.

@cschuchardt88
Copy link
Member Author

Yes but

We use a custom express plugin to do this. However we are still using the core of RPC Server with add-ons of custom methods.

That's the reason why we need this feature. This is for neo-express to get and display the correct error. There is no way currently to do this.

@cschuchardt88
Copy link
Member Author

added in #865

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants