(action: &str, required_scope: &str, status: Status)
| 4255 | } |
| 4256 | |
| 4257 | fn service_status_error(action: &str, required_scope: &str, status: Status) -> miette::Report { |
| 4258 | let message = status.message(); |
| 4259 | match status.code() { |
| 4260 | Code::PermissionDenied => { |
| 4261 | miette!("{action} failed: permission denied (requires {required_scope})") |
| 4262 | } |
| 4263 | Code::Unauthenticated => miette!("{action} failed: authentication required"), |
| 4264 | Code::NotFound if message == "sandbox not found" => { |
| 4265 | miette!("{action} failed: sandbox not found") |
| 4266 | } |
| 4267 | Code::NotFound if message == "service endpoint not found" => { |
| 4268 | miette!("{action} failed: service endpoint not found") |
| 4269 | } |
| 4270 | Code::InvalidArgument if !message.is_empty() => { |
| 4271 | miette!("{action} failed: invalid request: {message}") |
| 4272 | } |
| 4273 | _ => miette!("{action} failed: {status}"), |
| 4274 | } |
| 4275 | } |
| 4276 | |
| 4277 | fn print_service_endpoint_table(services: &[ServiceEndpointResponse], gateway_endpoint: &str) { |
| 4278 | let rows = services |
no test coverage detected