# VariableErrorHandlingDescriptor

Import: `import com.install4j.api.beans.VariableErrorHandlingDescriptor;`

```java
public class VariableErrorHandlingDescriptor
```

Specifies the error handling for variable replacements. Instances of this class are passed to some of the
`replaceVariables(...)` methods in [`AbstractBean`](AbstractBean.md).

Each variable type (installer variable, I18N message, compiler and form variable) has its own error handling.

Note: compiler variables in the project are replaced at compile time. Compiler variables in external files,
such as a custom localization file, are not replaced at compile time.

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`getInstallerVariables()`](#getinstallervariables) | `VariableErrorHandling` | Returns the error handling for installer variables. |
| [`getI18nKeys()`](#geti18nkeys) | `VariableErrorHandling` | Returns the error handling for localization keys. |
| [`getCompilerVariables()`](#getcompilervariables) | `VariableErrorHandling` | Returns the error handling for compiler variables. |
| [`getFormVariables()`](#getformvariables) | `VariableErrorHandling` | Returns the error handling for form variables. |

### getInstallerVariables()

```java
public VariableErrorHandling getInstallerVariables()
```

Returns the error handling for installer variables.


**Returns:** the error handling

### getI18nKeys()

```java
public VariableErrorHandling getI18nKeys()
```

Returns the error handling for localization keys.


**Returns:** the error handling

### getCompilerVariables()

```java
public VariableErrorHandling getCompilerVariables()
```

Returns the error handling for compiler variables.


**Returns:** the error handling

### getFormVariables()

```java
public VariableErrorHandling getFormVariables()
```

Returns the error handling for form variables.


**Returns:** the error handling

## Constructors

| Signature | Description |
|---|---|
| [`VariableErrorHandlingDescriptor(VariableErrorHandling, VariableErrorHandling, VariableErrorHandling)`](#variableerrorhandlingdescriptor-variableerrorhandling-variableerrorhandling-variableerrorhandling) | Construct a custom variable error handling Like [`VariableErrorHandlingDescriptor.VariableErrorHandlingDescriptor`](VariableErrorHandlingDescriptor.md#variableerrorhandlingdescriptor-variableerrorhandling-variableerrorhandling-variableerrorhandling-variableerrorhandling) with formVariables set to [`VariableErrorHandling.ERROR_MESSAGE`](VariableErrorHandling.md#error-message). |
| [`VariableErrorHandlingDescriptor(VariableErrorHandling, VariableErrorHandling, VariableErrorHandling, VariableErrorHandling)`](#variableerrorhandlingdescriptor-variableerrorhandling-variableerrorhandling-variableerrorhandling-variableerrorhandling) | Construct a custom variable error handling |

### VariableErrorHandlingDescriptor(VariableErrorHandling, VariableErrorHandling, VariableErrorHandling)

```java
public VariableErrorHandlingDescriptor(VariableErrorHandling installerVariables, VariableErrorHandling i18nKeys, VariableErrorHandling compilerVariables)
```

Construct a custom variable error handling
Like [`VariableErrorHandlingDescriptor.VariableErrorHandlingDescriptor`](VariableErrorHandlingDescriptor.md#variableerrorhandlingdescriptor-variableerrorhandling-variableerrorhandling-variableerrorhandling-variableerrorhandling)
with formVariables set to [`VariableErrorHandling.ERROR_MESSAGE`](VariableErrorHandling.md#error-message).

### VariableErrorHandlingDescriptor(VariableErrorHandling, VariableErrorHandling, VariableErrorHandling, VariableErrorHandling)

```java
public VariableErrorHandlingDescriptor(VariableErrorHandling installerVariables, VariableErrorHandling i18nKeys, VariableErrorHandling compilerVariables, VariableErrorHandling formVariables)
```

Construct a custom variable error handling


**Parameters:**

- `installerVariables` — error handling for installer variables
- `i18nKeys` — error handling for localization keys
- `compilerVariables` — error handling for compiler variables
- `formVariables` — error handling for form variables

## Fields

| Field | Type | Description |
|---|---|---|
| [DEFAULT](#default) | `VariableErrorHandlingDescriptor` | The default error handling. |
| [ALWAYS_IGNORE](#always-ignore) | `VariableErrorHandlingDescriptor` | Ignore all undefined variables. |
| [ALWAYS_ERROR_MESSAGE](#always-error-message) | `VariableErrorHandlingDescriptor` | Always replace undefined variables with an error message. |
| [ALWAYS_EXCEPTION](#always-exception) | `VariableErrorHandlingDescriptor` | Always throw exceptions for undefined variables. |

### DEFAULT

```java
public static final VariableErrorHandlingDescriptor DEFAULT
```

The default error handling. Throws an exception for undefined installer variables and replaces undefined
localization keys, compiler variables and form variables with an error message.

### ALWAYS_IGNORE

```java
public static final VariableErrorHandlingDescriptor ALWAYS_IGNORE
```

Ignore all undefined variables.

### ALWAYS_ERROR_MESSAGE

```java
public static final VariableErrorHandlingDescriptor ALWAYS_ERROR_MESSAGE
```

Always replace undefined variables with an error message.

### ALWAYS_EXCEPTION

```java
public static final VariableErrorHandlingDescriptor ALWAYS_EXCEPTION
```

Always throw exceptions for undefined variables.

