Function ros2_medkit_gateway::http::detail::write_generic_error
Defined in File primitives.hpp
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:
The{ "error_code": "<code>", "message": "<message>", "parameters": { ... } }
parameterskey is omitted whenerr.paramsis null or empty. For vendor-specific error codes (x-medkit-*), the wireerror_codeis rewritten tovendor-errorand the original code is reported asvendor_code.- Parameters:
token – Framework access token (constructible only by friends).
res – HTTP response to mutate.
err – Transport-neutral error descriptor.
err.http_statusis clamped into the SOVD range 400-599.