Interpret the result of `get_view_manifest`, turning "server predates manifest support" into a hard, actionable error. Identity-preserving push has no fallback: this client no longer flattens views, so a server without `?view-manifest` support cannot be pushed to.
(
result: Result<Option<String>, RemoteError>,
url: &str,
)
| 259 | /// Identity-preserving push has no fallback: this client no longer flattens |
| 260 | /// views, so a server without `?view-manifest` support cannot be pushed to. |
| 261 | pub fn require_manifest_support( |
| 262 | result: Result<Option<String>, RemoteError>, |
| 263 | url: &str, |
| 264 | ) -> CliResult<Option<String>> { |
| 265 | match result { |
| 266 | Ok(text) => Ok(text), |
| 267 | Err(RemoteError::ProtocolError { message }) => Err(CliError::RemoteError { |
| 268 | message: format!( |
| 269 | "The server does not support view manifests ({}). \ |
| 270 | Identity-preserving push requires a server upgrade; \ |
| 271 | this client no longer flattens views on push.", |
| 272 | message |
| 273 | ), |
| 274 | url: Some(url.to_string()), |
| 275 | }), |
| 276 | Err(e) => Err(convert_remote_error(e, url)), |
| 277 | } |
| 278 | } |
| 279 | |
| 280 | /// Parse and verify a remote manifest, mapping failures to remote errors. |
| 281 | /// |