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

Function require_manifest_support

atomic-cli/src/commands/push/helpers.rs:315–332  ·  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

313/// Identity-preserving push has no fallback: this client no longer flattens
314/// views, so a server without `?view-manifest` support cannot be pushed to.
315pub fn require_manifest_support(
316 result: Result<Option<String>, RemoteError>,
317 url: &str,
318) -> CliResult<Option<String>> {
319 match result {
320 Ok(text) => Ok(text),
321 Err(RemoteError::ProtocolError { message }) => Err(CliError::RemoteError {
322 message: format!(
323 "The server does not support view manifests ({}). \
324 Identity-preserving push requires a server upgrade; \
325 this client no longer flattens views on push.",
326 message
327 ),
328 url: Some(url.to_string()),
329 }),
330 Err(e) => Err(convert_remote_error(e, url)),
331 }
332}
333
334/// Parse and verify a remote manifest, mapping failures to remote errors.
335///

Calls 1

convert_remote_errorFunction · 0.70