pub fn default_srv_error_response<M, F>(
err: &ErrorMsg<M>,
response_builder: F,
) -> Result<Response<BoxBody<Bytes, Infallible>>, HttpError>Expand description
Convert a service error message into a default HTTP response.
This provides a default mapping from prosa::core::service::ServiceError variants to HTTP status codes:
NoError->202 AcceptedUnableToReachService->503 Service UnavailableTimeout->504 Gateway TimeoutProtocolError->502 Bad Gateway
The response_builder parameter allows customizing the response headers (e.g., adding a Server header).