Skip to content

Params conversion error raises internal error #123

Description

@CLTanuki

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"
}

Activity

  1. Astn commented on Jan 22, 2021

    @Astn
    Owner

    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.
  2. CLTanuki commented on Jan 23, 2021

    @CLTanuki
    Author

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

  3. Astn commented on Sep 24, 2026

    @Astn
    Owner

    Landed on master in #148 (merge commit 773289b), released as 2.0.0.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions