# Try Catch

**Introduction**

The "Try-Catch" step is used to handle errors and exceptions that might occur during the execution of an automation. This step allows you to define actions to attempt ("Try") and specify alternative actions ("Catch") if an error occurs.

**Subpaths**

* **Try**: This subpath contains the actions that you want to attempt. If these actions execute successfully, the automation proceeds without entering the "Catch" subpath.
* **Catch**: This subpath contains the actions to be executed if an error or exception occurs during the "Try" subpath.
  * **Exception**: An object variable within the "Catch" subpath that provides details about the error. It includes:
    * **Message**: The error message, which may be null if not available.

This step allows you to manage errors gracefully, ensuring that your automation can continue or handle failures as needed.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flexy.bot/modules/scripting/steps/try-catch.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
