(
error_type: &str,
extension_id: &str,
error_str: &str,
request: Option<ErrorRequest<'_>>,
)
| 118 | } |
| 119 | |
| 120 | fn error_request( |
| 121 | error_type: &str, |
| 122 | extension_id: &str, |
| 123 | error_str: &str, |
| 124 | request: Option<ErrorRequest<'_>>, |
| 125 | ) -> Result<Request<Body>, Error> { |
| 126 | let uri = format!("/2020-01-01/extension/{error_type}/error"); |
| 127 | |
| 128 | let body = match request { |
| 129 | None => Body::empty(), |
| 130 | Some(err) => Body::from(serde_json::to_string(&err)?), |
| 131 | }; |
| 132 | |
| 133 | let req = build_request() |
| 134 | .method(Method::POST) |
| 135 | .uri(uri) |
| 136 | .header(EXTENSION_ID_HEADER, extension_id) |
| 137 | .header(EXTENSION_ERROR_TYPE_HEADER, error_str) |
| 138 | .body(body)?; |
| 139 | Ok(req) |
| 140 | } |
no test coverage detected