improve display of GetSessionError

This commit is contained in:
Joseph Montanaro
2023-07-11 14:34:54 -07:00
parent 52c949e396
commit 486001b584
3 changed files with 12 additions and 6 deletions

View File

@ -57,8 +57,12 @@ where
E: Error,
M: serde::ser::SerializeMap,
{
let src = err.source().map(|s| format!("{s}"));
map.serialize_entry("source", &src)
let msg = err.source().map(|s| format!("{s}"));
map.serialize_entry("msg", &msg)?;
map.serialize_entry("code", &None::<&str>)?;
map.serialize_entry("source", &None::<&str>)?;
Ok(())
}