diff --git a/README.md b/README.md index cdfb7327..96295d4b 100644 --- a/README.md +++ b/README.md @@ -125,13 +125,17 @@ The list below captures what may need to add depending on your usage: Life cycle events are directly managed on the application controller and are prefixed with `on_*`. +* **on_server_start** : Executed at server.start() call while passing the server as argument. +* **on_server_bind** : WSLinkServer is getting bound to trame so you can attach your own routes. Its instance will be passed as argument to callback. * **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_exited** : Trame is exiting its event loop -* **on_server_reload** : If callback registered it is used for reloading server side modules +* **on_error** : JS error forwarded (msg:str) on the python +* **on_exception** : Server exception occurred when interacting with the UI. The exception instance is provided as arg. +* **on_server_reload** : If callback registered it is used for reloading server side modules ## Reserved state entries diff --git a/README.rst b/README.rst index 2ded77c9..a6e0f727 100644 --- a/README.rst +++ b/README.rst @@ -117,6 +117,8 @@ Life cycle callbacks Life cycle events are directly managed on the application controller and are prefixed with `on_*`. +* **on_server_start** : Executed at server.start() call while passing the server as argument. +* **on_server_bind** : WSLinkServer is getting bound to trame so you can attach your own routes. Its instance will be passed as argument to callback. * **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 @@ -124,7 +126,7 @@ and are prefixed with `on_*`. * **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 occurred in the client, can be used to do something on the server when this occurs - +* **on_exception** : Server exception occurred when interacting with the UI. The exception instance is provided as arg. Reserved state entries -------------------------------------------------------------------------- diff --git a/examples/validation/decorators/default_class_decorator.py b/examples/validation/decorators/default_class_decorator.py index 8af9688a..74f660d2 100644 --- a/examples/validation/decorators/default_class_decorator.py +++ b/examples/validation/decorators/default_class_decorator.py @@ -36,7 +36,7 @@ def on_ready(self, *args, **kwargs): @life_cycle.on_error def on_error(self, message): - print(f"A JS error occured: {message}") + print(f"A JS error occurred: {message}") def ui(self): with SinglePageLayout(self.server) as layout: