MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / parse_error_with_code_and_message

Function parse_error_with_code_and_message

nodedb/src/control/security/deny.rs:198–214  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

196
197 #[test]
198 fn parse_error_with_code_and_message() {
199 let parts = vec![
200 "ERROR",
201 "'INSUFFICIENT_SCOPE'",
202 "MESSAGE",
203 "'You cannot access this'",
204 ];
205 let mode = parse_on_deny(&parts).unwrap();
206 match mode {
207 DenyMode::Error(err) => {
208 assert_eq!(err.code, "INSUFFICIENT_SCOPE");
209 assert_eq!(err.message, "You cannot access this");
210 assert!(err.detail.is_none());
211 }
212 _ => panic!("expected Error mode"),
213 }
214 }
215
216 #[test]
217 fn parse_error_with_detail() {

Callers

nothing calls this directly

Calls 1

parse_on_denyFunction · 0.85

Tested by

no test coverage detected