Custom Errors
Custom Errors Setup
How to setup custom errors in your project
Prerequisite Please see here to get and set your API Key environment variable.
Install the lytix SDK
(Reccomended) Set you API key via the environment variable
export LX_API_KEY=<your-api-key-here>
Set your API key in the code
Error Class
You can now just replace all your raise Exception
calls with raise LError
. For example:
The error, along with the last 20 log lines will automatically get pushed to the Lytix platform here. See example event here:
Error Increment
You can also send an error along with related logs without throwing an error by using the increment
method.
Examples
To see all examples please check the Github repo here