oxidecomputer / dropshot

expose REST APIs from a Rust program
Apache License 2.0
843 stars 74 forks source link

[12/n] [dropshot] improve API endpoint registration error messages #1050

Closed sunshowers closed 2 months ago

sunshowers commented 3 months ago

Currently, the bulk builder functions created by the api_description macro don't provide information about which endpoint(s) failed to register. This leads to a pretty suboptimal devx with large APIs like Nexus.

To address this, use a structured error type, and also carry information about the operation ID (endpoint name) that was registered. Use this to produce better messages for both ApiDescription::register, and the bulk builder functions created by the api_description macro.