server: improve add_warning method
Add an exc_info parameter that optionally takes an exception that is passed to the logging function. This will log the traceback without an additional logging call. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
@@ -31,7 +31,7 @@ class ButtonManager:
|
||||
btn = GpioButton(cfg)
|
||||
except Exception as e:
|
||||
msg = f"Failed to load button [{cfg.get_name()}]\n{e}"
|
||||
self.server.add_warning(msg)
|
||||
self.server.add_warning(msg, exc_info=e)
|
||||
continue
|
||||
self.buttons[btn.name] = btn
|
||||
self.server.register_notification("button:button_event")
|
||||
|
Reference in New Issue
Block a user