Skip to content

Commit

Permalink
use a more helpful error message when accessing invalid properties fr…
Browse files Browse the repository at this point in the history
…om a callback context
  • Loading branch information
emuell committed Jul 6, 2024
1 parent b1a26af commit 8be9d17
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/bindings/callback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,10 @@ impl LuaCallbackContext {
// slower path (string )
value.into_lua(lua)
} else {
Err(mlua::Error::RuntimeError(
"no such field in context".to_string(),
))
Err(mlua::Error::RuntimeError(format!(
"undefined field '{}' in context",
key.to_string_lossy()
)))
}
},
)
Expand Down

0 comments on commit 8be9d17

Please sign in to comment.