From be45d7fcb7b6c8bd526f295e1b51e2afe2de0b8c Mon Sep 17 00:00:00 2001 From: rasul Date: Sun, 5 Apr 2020 16:15:41 -0500 Subject: [PATCH] improve error messages --- src/world/room.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/world/room.rs b/src/world/room.rs index acfd45b..3ad6003 100644 --- a/src/world/room.rs +++ b/src/world/room.rs @@ -79,14 +79,14 @@ impl<'a> TryFrom<&Row<'a>> for Room { fn try_from(row: &Row) -> Result { 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(), }) }