MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / require_manifest_support

Function require_manifest_support

atomic-cli/src/commands/push/helpers.rs:272–289  ·  view source on GitHub ↗

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,
)

Source from the content-addressed store, hash-verified

270/// Identity-preserving push has no fallback: this client no longer flattens
271/// views, so a server without `?view-manifest` support cannot be pushed to.
272pub fn require_manifest_support(
273 result: Result<Option<String>, RemoteError>,
274 url: &str,
275) -> CliResult<Option<String>> {
276 match result {
277 Ok(text) => Ok(text),
278 Err(RemoteError::ProtocolError { message }) => Err(CliError::RemoteError {
279 message: format!(
280 "The server does not support view manifests ({}). \
281 Identity-preserving push requires a server upgrade; \
282 this client no longer flattens views on push.",
283 message
284 ),
285 url: Some(url.to_string()),
286 }),
287 Err(e) => Err(convert_remote_error(e, url)),
288 }
289}
290
291/// Parse and verify a remote manifest, mapping failures to remote errors.
292///

Calls 1

convert_remote_errorFunction · 0.70