# Exit error

Instrukcja Exit error kończy wykonywanie skryptu i zgłasza zdefiniowany przez użytkownika błąd skryptu.

Exit Error expression [(when | unless condition)]

Ponieważ Exit error to instrukcja sterowania, jest ona kończona średnikiem lub znakiem końca wiersza i nie może przekraczać granicy wiersza.

Argumenty

| Argument | Opis |
| --- | --- |
| expression | Wartość, która jest szacowana i zwracana jako wywołany przez użytkownika komunikat o błędzie skryptu. |
| when / unless condition | Opcjonalny warunek. when zgłasza błąd, gdy warunek jest prawdziwy. unless zgłasza błąd, gdy warunek jest fałszywy. |

```
//Exit error
Exit Error 'Load validation failed';
```

```
//Exit error when a condition is fulfilled
Exit Error 'Source connection unavailable' when vConnectionOk=0;
```

```
//Exit error unless a condition is fulfilled
Exit Error 'Required variable is missing' unless len(trim(vRequiredVar))>0;
```

[Używanie skryptów na poziomie wykresu w wizualizacjach](https://help.qlik.com/pl-PL/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartLevelScripting/chart-level-scripting.htm)

[Exit](https://help.qlik.com/pl-PL/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartLevelScripting/ControlStatements/Exit.htm)

[Exit script](https://help.qlik.com/pl-PL/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartLevelScripting/ControlStatements/exit-script.htm)

[Instrukcje sterowania](https://help.qlik.com/pl-PL/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartLevelScripting/modifier-control-statements.htm)