emit_signal: Log errors
Instead of returning errors that happen in the actual Lua callback
function to the caller, these are now just logged. This is the same
behaviour as with awesome.
@@ -45,12 +45,17 @@ pub fn emit_signal<'lua, A>(_: &'lua Lua,
let signals = obj.signals()?;
trace!("Checking signal {}", name);
let obj_table = obj.table();
- if let Ok(Value::Table(table)) = signals.get::<_, Value>(name) {
+ if let Ok(Value::Table(table)) = signals.get::<_, Value>(name.clone()) {
for entry in table.pairs::<Value, Function>() {
if let Ok((_, func)) = entry {
trace!("Found func for signal");
- func.bind(obj_table.clone())?
- .call(args.clone())?
+ match func.bind(obj_table.clone())?
+ .call(args.clone()) {
+ Ok(()) => {},
+ Err(e) => {
+ error!("Error while emitting signal {}: {}", name, e);
+ }
+ };
}
}
}
