open-rpc / spec

The OpenRPC specification
https://spec.open-rpc.org
Apache License 2.0
166 stars 49 forks source link

Add description for errors #340

Open bevalorous opened 3 years ago

bevalorous commented 3 years ago

A description field could be helpful for adding some additional information to the errors that doesn't necessarily end up going over the wire: what the error means, when and why it happens, how it can be handled or walked around, which actions may be performed to mitigate it, etc.

github-actions[bot] commented 3 years ago

Welcome to OpenRPC! Thank you for taking the time to create an issue. Please review the guidelines

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

BelfordZ commented 2 years ago

Hey there

Good thinking. code, message and data are all fields which are returned as part of the json-rpc error response. As such, there is no where to add documentation that is to be consumed outside the request-response lifecycle.

In addition to description, I think we should also add a name field, which is essential for code generators to be able to produce typed errors.