File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,6 +58,9 @@ and are prefixed with ``on_*``.
5858* **on_client_exited ** : Linked to browser "beforeunload" event
5959* **on_server_exited ** : Trame is exiting its event loop
6060
61+ * **on_error ** : JS error forwarded (msg:str) on the python
62+ * **on_exception ** : Server exception occurred when interacting with the UI. The exception instance is provided as arg.
63+
6164* **on_server_reload ** : If callback registered it can be use to hot_reload methods like the UI.
6265
6366
Original file line number Diff line number Diff line change @@ -94,6 +94,13 @@ def port_callback(self, port_used):
9494 self .server ._running_stage = 2
9595 self .server .state .ready ()
9696 self .server .context .ready ()
97+
98+ # Add on_server_exception
99+ self .server .protocol .log_emitter .add_event_listener (
100+ "exception" , self .server .controller .on_exception .enable_empty ()
101+ )
102+
103+ # Trigger on_server_ready
97104 if self .server .controller .on_server_ready .exists ():
98105 self .server .controller .on_server_ready (** self .server .state .to_dict ())
99106
You can’t perform that action at this time.
0 commit comments