# Error handling & support

The causalchamber [package](https://github.com/juangamella/causal-chamber-package) can raise two types of errors

<table data-header-hidden><thead><tr><th width="145.614990234375">Error</th><th>Description</th></tr></thead><tbody><tr><td><code>LabError</code></td><td>This indicates an error on our side, e.g., due to a hardware failure or an internal server error.</td></tr><tr><td><code>UserError</code></td><td>These can arise during normal operation of the system—e.g., you reached the limit of queued experiments—or result from an error on your side, such as setting incorrect credentials or submitting an invalid instruction.</td></tr></tbody></table>

In either case, if an error persists or you are stuck, please let us know so we can help you. You can reach us at <support@causalchamber.ai> or through any of the support channels provided during onboarding.

{% hint style="info" %}
See [Troubleshooting](https://docs.causalchamber.ai/support/troubleshooting) for a list of common issues and how to solve them.
{% endhint %}

### Example

Let's trigger a `UserError` by sending an invalid instruction to a chamber.

```python
import causalchamber.lab as lab

# Open a real-time connection
chamber = lab.Chamber(chamber_id = 'lt-demo-ch4lu',
                      config = 'standard',
                      credentials_file = '.credentials')

# Submit an invalid instruction (value out of range)
chamber.set('red', 999)
```

This raises the following exception

```python
---------------------------------------------------------------------------
UserError                                 Traceback (most recent call last)
[Trace details omitted]
UserError: (code 400) Line 1: Value 999 for variable 'red' is above maximum 255
  Trace codes
      (chamber: c687d22c-d07e-4aec-8ef1-0fd3ae40b188)
    (scheduler: cc512e6c-c11f-43d2-afdb-030b3bae9847)
```

Besides a description of the error and the traceback, the exception also provides **trace codes**, e.g., the uuid strings `c687d22c-d07e-4aec-8ef1-0fd3ae40b188` and `cc512e6c-c11f-43d2-afdb-030b3bae9847`. These allow us to track your request through our entire stack.

### Reporting errors

{% hint style="info" %}
The best way to report an error is to send us the complete error trace, including the traceback and **trace codes**.
{% endhint %}

You can report an error through <support@causalchamber.ai> or any of the support channels provided during onboarding.
