# Handling Job Failures

#### 1. Default Error task

If a task has a name: **Default Failure**, that task will capture all failures without connecting the red lines to it.

Instead of connecting each task failure point to one task:\
![Bad usage](Handling-Job-Failures/bad_usage.png)

Use **Default Failure** task to handle failures:

![Default failure task](Handling-Job-Failures/default_failure_task.png)

#### 2. Job Failure email template

Create an email template with the name: **JOB_FAILURE** (see [Email Templates](Email-Templates.md)), if a job exits in a failed state, it sends an email based on the configured email template.

![Job failure email template](Handling-Job-Failures/job_failure_email_template.png)

#### 3 Failure related variables

```
{task_error}
{task_errors}
{task_error_name}
{task_error_names}
{error}
{full_log}
```
