MCPcopy Create free account
hub / github.com/3Hren/msgpack-rust / error_trait

Function error_trait

src/encode/value_ref.rs:149–160  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

147
148 #[test]
149 fn error_trait() {
150 // Delegates to I/O Error.
151 let err = Error(WriteError(io::Error::new(io::ErrorKind::Other, "unexpected EOF")));
152
153 fn test<E: error::Error>(err: E) {
154 assert_eq!("error while writing MessagePack'ed value", err.description());
155 assert!(err.cause().is_some());
156 assert_eq!("unexpected EOF", err.cause().unwrap().description());
157 }
158
159 test(err);
160 }
161}

Callers

nothing calls this directly

Calls 3

WriteErrorClass · 0.85
testFunction · 0.85
ErrorClass · 0.70

Tested by

no test coverage detected