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

Params conversion error raises internal error #123

Open
CLTanuki opened this issue Jan 22, 2021 · 2 comments
Open

Params conversion error raises internal error #123

CLTanuki opened this issue Jan 22, 2021 · 2 comments

Comments

@CLTanuki
Copy link

In our mind, params-related error should raise -32700 or -32602 error.

{
  "jsonrpc": "2.0",
  "error": {
    "code": -32603,
    "message": "Internal Error",
    "data": {
      "ClassName": "System.ArgumentException",
      "Message": "Невозможно преобразовать объект типа 'Newtonsoft.Json.Linq.JValue' к типу 'System.Guid'.",
      "Data": null,
      "InnerException": null,
      "HelpURL": null,
      "StackTraceString": "   в System.RuntimeType.TryChangeType(Object value, Binder binder, CultureInfo culture, Boolean needsSpecialCast)\\r\\n   в System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr)\\r\\n   в System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig)\\r\\n   в System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\\r\\n   в System.Delegate.DynamicInvokeImpl(Object[] args)\\r\\n   в System.Delegate.DynamicInvoke(Object[] args)\\r\\n   в AustinHarris.JsonRpc.Handler.Handle(JsonRequest Rpc, Object RpcContext)",
      "RemoteStackTraceString": null,
      "RemoteStackIndex": 0,
      "ExceptionMethod": "8\\nTryChangeType\\nmscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\\nSystem.RuntimeType\\nSystem.Object TryChangeType(System.Object, System.Reflection.Binder, System.Globalization.CultureInfo, Boolean)",
      "HResult": -2147024809,
      "Source": "mscorlib",
      "WatsonBuckets": null,
      "ParamName": null
    }
  },
  "id": "0d1b763d-e0cb-4261-818e-02d439eea8f4"
}
@Astn
Copy link
Owner

Astn commented Jan 22, 2021

I think your right. -32602 seems to be the most specific for this case.

code message meaning
-32700 Parse error Invalid JSON was received by the server.An error occurred on the server while parsing the JSON text.
-32600 Invalid Request The JSON sent is not a valid Request object.
-32601 Method not found The method does not exist / is not available.
-32602 Invalid params Invalid method parameter(s).
-32603 Internal error Internal JSON-RPC error.
-32000 to -32099 Server error Reserved for implementation-defined server-errors.

@CLTanuki
Copy link
Author

You can reproduce this error, passing string to the method, which requires Guid.

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

No branches or pull requests

2 participants