Function ros2_medkit_gateway::http::detail::write_generic_error

Function Documentation

void ros2_medkit_gateway::http::detail::write_generic_error(FrameworkOrPluginAccess token, httplib::Response &res, const ErrorInfo &err)

Write a SOVD GenericError response.

Body shape:

{ "error_code": "<code>", "message": "<message>", "parameters": { ... } }
The parameters key is omitted when err.params is null or empty. For vendor-specific error codes (x-medkit-*), the wire error_code is rewritten to vendor-error and the original code is reported as vendor_code.

Parameters:
  • token – Framework access token (constructible only by friends).

  • res – HTTP response to mutate.

  • err – Transport-neutral error descriptor. err.http_status is clamped into the SOVD range 400-599.