gorilla / rpc

Package gorilla/rpc is a golang foundation for RPC over HTTP services.
https://gorilla.github.io
BSD 3-Clause "New" or "Revised" License
590 stars 179 forks source link

json unmarshal of payload does not support custom type errors #70

Open lllwvlvwlll opened 5 years ago

lllwvlvwlll commented 5 years ago

reference: https://github.com/gorilla/rpc/blob/master/v2/json2/server.go#L165

Per the link above, if using a custom type in args which fails to parse, resulting in a verbose error message, there is a false assumption that the json params is not a structured object.

The subsequent attempt to parse out into a map interface will also fail because the data is actually structured, but the content is malformed.

This results in a misleading error message