(&self)
| 303 | #[cfg(feature = "with-actix-web")] |
| 304 | impl actix_web::error::ResponseError for ApiError { |
| 305 | fn error_response(&self) -> actix_web::HttpResponse { |
| 306 | let json = self.to_http_api_problem().json_bytes(); |
| 307 | let actix_status = actix_web::http::StatusCode::from_u16(self.status.as_u16()) |
| 308 | .unwrap_or(actix_web::http::StatusCode::INTERNAL_SERVER_ERROR); |
| 309 | |
| 310 | actix_web::HttpResponse::build(actix_status) |
| 311 | .header( |
| 312 | actix_web::http::header::CONTENT_TYPE, |
| 313 | PROBLEM_JSON_MEDIA_TYPE, |
| 314 | ) |
| 315 | .body(json) |
| 316 | } |
| 317 | } |
| 318 | |
| 319 | #[cfg(feature = "with-warp")] |
nothing calls this directly
no test coverage detected