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

Function error

libatomic/examples/replication_acceptance/peer.rs:123–129  ·  view source on GitHub ↗
(message: impl ToString)

Source from the content-addressed store, hash-verified

121 headers.get(PROTOCOL_HEADER).and_then(|h| h.to_str().ok()) == Some(PROTOCOL_SYNC_V1)
122}
123fn error(message: impl ToString) -> Response {
124 reply(
125 StatusCode::BAD_REQUEST,
126 message.to_string().into_bytes(),
127 "text/plain",
128 )
129}
130async fn push(State(endpoint): State<Endpoint>, headers: HeaderMap, body: Bytes) -> Response {
131 if !supported(&headers) {
132 return error("acceptance endpoint requires actual binary sync protocol");

Callers 2

pushFunction · 0.70
pullFunction · 0.70

Calls 1

replyFunction · 0.85

Tested by

no test coverage detected