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> {
Ok(Self {
id: try_log!(row.get("id"), "id"),
zone: try_log!(row.get("zone"), "zone"),
name: try_log!(row.get("name"), "name"),
description: try_log!(row.get::<&str, String>("description"), "description")
id: try_log!(row.get("id"), "Unable to get column 'id' from row"),
zone: try_log!(row.get("zone"), "Unable to get column 'zone' from row"),
name: try_log!(row.get("name"), "Unable to get column 'name' from row"),
description: try_log!(row.get::<&str, String>("description"), "Unable to get column 'description' from row")
.lines()
.map(|s| String::from(s))
.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(),
})
}

Loading…
Cancel
Save