From 7a31717ac6e4adf0178e459cde7cb3fbc2fbcebb Mon Sep 17 00:00:00 2001 From: Tyler Walker Date: Thu, 11 Dec 2025 15:54:41 -0500 Subject: [PATCH 1/3] docs(readme): Document on_error, add on_server_start --- README.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 1852bb25..e98e74fd 100644 --- a/README.rst +++ b/README.rst @@ -120,9 +120,10 @@ and are prefixed with `on_*`. * **on_server_ready** : All protocols initialized and available for client to connect * **on_client_connected** : Connection established to server * **on_client_exited** : Linked to browser "beforeunload" event +* **on_server_start** : Trame is starting its event loop * **on_server_exited** : Trame is exiting its event loop - * **on_server_reload** : If callback registered it is used for reloading server side modules +* **on_error** : A JavaScript error has occured in the client, can be used to do something on the server when this occurs Reserved state entries From ba3fc81d246cbe0f14722b4e31552812ab4c6cc9 Mon Sep 17 00:00:00 2001 From: Tyler Walker Date: Thu, 11 Dec 2025 16:01:25 -0500 Subject: [PATCH 2/3] chore(readme): Typo --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index e98e74fd..2ded77c9 100644 --- a/README.rst +++ b/README.rst @@ -123,7 +123,7 @@ and are prefixed with `on_*`. * **on_server_start** : Trame is starting its event loop * **on_server_exited** : Trame is exiting its event loop * **on_server_reload** : If callback registered it is used for reloading server side modules -* **on_error** : A JavaScript error has occured in the client, can be used to do something on the server when this occurs +* **on_error** : A JavaScript error has occurred in the client, can be used to do something on the server when this occurs Reserved state entries From fd735a3b1568a1c28faa7b875da7c4120935cbbd Mon Sep 17 00:00:00 2001 From: Tyler Walker Date: Thu, 11 Dec 2025 16:03:26 -0500 Subject: [PATCH 3/3] chore(example): Add LifeCycle.on_error to example --- examples/validation/decorators/default_class_decorator.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/validation/decorators/default_class_decorator.py b/examples/validation/decorators/default_class_decorator.py index a396fe33..8af9688a 100644 --- a/examples/validation/decorators/default_class_decorator.py +++ b/examples/validation/decorators/default_class_decorator.py @@ -34,6 +34,10 @@ def one_slider(self, slider_value1, **kwargs): def on_ready(self, *args, **kwargs): print("on_ready") + @life_cycle.on_error + def on_error(self, message): + print(f"A JS error occured: {message}") + def ui(self): with SinglePageLayout(self.server) as layout: with layout.toolbar: @@ -47,6 +51,7 @@ def ui(self): vuetify.VBtn("trigger", click="trigger('exec')") vuetify.VBtn("method", click=self.method_call) vuetify.VBtn("ctrl", click=self.ctrl.hello) + vuetify.VBtn("JS error", click="undefined_func()") app = App()