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

Function parse_error_body_401

atomic-remote/src/storage.rs:417–423  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

415
416 #[test]
417 fn parse_error_body_401() {
418 let client = StorageClient::new("https://example.com", "acme", "tok").unwrap();
419 let body = r#"{"success":false,"error":{"code":"UNAUTHORIZED","message":"bad token"}}"#;
420 let err = client.parse_error_body(401, body);
421 assert!(err.to_string().contains("bad token"));
422 assert!(err.is_auth_error());
423 }
424
425 #[test]
426 fn parse_error_body_404() {

Callers

nothing calls this directly

Calls 2

parse_error_bodyMethod · 0.80
unwrapMethod · 0.45

Tested by

no test coverage detected