coinbase / mesh-specifications

Specification files for the Mesh Blockchain Standard
Apache License 2.0
324 stars 92 forks source link

Add a `description` field for the `Error` model #59

Closed bkase closed 3 years ago

bkase commented 3 years ago

Is your feature request related to a problem? Please describe.

An error's name should be concise and canonical, but sometimes it's hard to come up with a concise name that accurately describes what an error means. It would be great to express what an error means with a longer text field that can change between versions and not break any programs built against the API.

Describe the solution you'd like

Add an (optional) description field to the Error model. This can be used for the purpose of describing what an error means. It is not machine-checked and only there to help developers.

Describe alternatives you've considered

Add no new field and use code comments to express error descriptions. It seems preferable to include the descriptions in the payload of the error so clients wouldn't need to read source code.

Additional context

One version of the Mina implementation of the Rosetta spec included a misunderstanding of the details field that was co-opted to serve this purpose.

patrick-ogrady commented 3 years ago

Thanks for posting this, @bkase! This is a great idea.