Description
Currently, propolis-server
's API returns structured error codes for certain error conditions:
propolis/crates/propolis-api-types/src/lib.rs
Lines 443 to 485 in f255595
These are parsed by sled-agent
and used to detect particular error conditions, such as the propolis-server
believing that an instance-ensure request has never been received. At present, the enum representing these error codes is defined in the propolis-api-types
crate, which requires that sled-agent depend on it. The propolis-api-types
dependency is not otherwise needed by sled-agent. It would be much nicer if sled-agent could get the definition of the error code values from its propolis-client
dependency, instead. Ideally, these would be part of the OpenAPI document and generated by Progenitor when building the client, as discussed in oxidecomputer/omicron#6726 (comment)
Ideally, we would be able to define the error codes returned by these APIs as part of the Dropshot server and have them be included in the OpenAPI spec without requiring us to patch the document to include them. See oxidecomputer/dropshot#39 and oxidecomputer/dropshot#41 for related issues.