Skip to main content

parse_command

Function parse_command 

Source
pub fn parse_command(status: u16, body: Value) -> Result<CommandResponse>
Expand description

Interpret a raw (status, body) pair as the command envelope, applying the box’s error conventions:

  • 200 + success: true is the only success shape.
  • 501 means the box image predates the endpoint (Error::UnsupportedByBox).
  • Everything else (including success: false with HTTP 200, which the box uses for cross-role instrument conflicts) is Error::Box.