improve logging and errors

master
rasul 5 years ago
parent be45d7fcb7
commit 7e83c23855

@ -22,8 +22,14 @@ impl<'a> TryFrom<&Row<'a>> for Exit {
fn try_from(row: &Row) -> Result<Self, Self::Error> {
Ok(Self {
target: row.get("target")?,
direction: Direction::try_from_long(row.get::<&str, String>("direction")?)?,
target: try_log!(row.get("target"), "Unable to get column 'target' from row"),
direction: try_log!(
Direction::try_from_long(try_log!(
row.get::<&str, String>("direction"),
"Unable to get column 'direction' from row"
)),
"Unable to parse direction"
)
})
}
}

Loading…
Cancel
Save