commit b88e756809e2c7fa682686956dc1d109f8cb9275
parent dc8c0d82fbe4c4166e7d7c8df0c61945d37b7d1e
Author: Joris Vink <joris@coders.se>
Date: Thu, 29 Nov 2018 10:02:22 +0100
add tracer
Diffstat:
1 file changed, 40 insertions(+), 0 deletions(-)
diff --git a/api/python.md b/api/python.md
@@ -41,6 +41,7 @@ this worker process.
* [timer](#timer)
* [proc](#proc)
* [fatal](#fatal)
+ * [tracer](#tracer)
* [register\_database](#registerdatabase)
* [websocket\_broadcast](#websocketbroadcast)
@@ -238,6 +239,45 @@ kore.fatal('worker going dead')
---
+# <a name="tracer"></a>tracer
+
+### Synopsis
+
+```python
+kore.tracer(method)
+```
+
+### Description
+
+Sets the callback Kore will call for any uncaught exceptions.
+
+The callback will get 3 parameters:
+* The exception type
+* The exception value
+* The traceback
+
+| Parameter | Description |
+| --- | --- |
+| method | The method to call for uncaught exceptions. |
+
+### Returns
+
+Nothing
+
+### Example
+
+```python
+import traceback
+
+def tracer(etype, value, tb):
+ traceback.print_exception(etype, value, tb)
+
+def kore_parent_configure(args):
+ kore.tracer(tracer)
+```
+
+---
+
# <a name="websocketbroadcast"></a>websocket\_broadcast
### Synopsis