improve error messages

master
rasul 5 years ago
parent 0b50ce0650
commit be45d7fcb7

@ -79,14 +79,14 @@ impl<'a> TryFrom<&Row<'a>> for Room {
fn try_from(row: &Row) -> Result<Self, Self::Error> { fn try_from(row: &Row) -> Result<Self, Self::Error> {
Ok(Self { Ok(Self {
id: try_log!(row.get("id"), "id"), id: try_log!(row.get("id"), "Unable to get column 'id' from row"),
zone: try_log!(row.get("zone"), "zone"), zone: try_log!(row.get("zone"), "Unable to get column 'zone' from row"),
name: try_log!(row.get("name"), "name"), name: try_log!(row.get("name"), "Unable to get column 'name' from row"),
description: try_log!(row.get::<&str, String>("description"), "description") description: try_log!(row.get::<&str, String>("description"), "Unable to get column 'description' from row")
.lines() .lines()
.map(|s| String::from(s)) .map(|s| String::from(s))
.collect(), .collect(),
users_visible: try_log!(row.get("users_visible"), "users_visible"), users_visible: try_log!(row.get("users_visible"), "Unable to get column 'users_visible' from row"),
exits: HashMap::new(), exits: HashMap::new(),
}) })
} }

Loading…
Cancel
Save