# Class: ConfigurationError

Error thrown when configuration is missing or invalid. Use for missing environment variables, invalid settings, or setup issues.

## Example[​](#example "Direct link to Example")

```typescript
throw new ConfigurationError("DATABRICKS_HOST environment variable is required");
throw new ConfigurationError("Warehouse ID not found", { context: { env: "production" } });

```

## Extends[​](#extends "Direct link to Extends")

* [`AppKitError`](/appkit/docs/api/appkit/Class.AppKitError.md)

## Constructors[​](#constructors "Direct link to Constructors")

### Constructor[​](#constructor "Direct link to Constructor")

```ts
new ConfigurationError(message: string, options?: {
  cause?: Error;
  context?: Record<string, unknown>;
}): ConfigurationError;

```

#### Parameters[​](#parameters "Direct link to Parameters")

| Parameter          | Type                                                              |
| ------------------ | ----------------------------------------------------------------- |
| `message`          | `string`                                                          |
| `options?`         | { `cause?`: `Error`; `context?`: `Record`<`string`, `unknown`>; } |
| `options.cause?`   | `Error`                                                           |
| `options.context?` | `Record`<`string`, `unknown`>                                     |

#### Returns[​](#returns "Direct link to Returns")

`ConfigurationError`

#### Inherited from[​](#inherited-from "Direct link to Inherited from")

[`AppKitError`](/appkit/docs/api/appkit/Class.AppKitError.md).[`constructor`](/appkit/docs/api/appkit/Class.AppKitError.md#constructor)

## Properties[​](#properties "Direct link to Properties")

### cause?[​](#cause "Direct link to cause?")

```ts
readonly optional cause: Error;

```

Optional cause of the error

#### Inherited from[​](#inherited-from-1 "Direct link to Inherited from")

[`AppKitError`](/appkit/docs/api/appkit/Class.AppKitError.md).[`cause`](/appkit/docs/api/appkit/Class.AppKitError.md#cause)

***

### code[​](#code "Direct link to code")

```ts
readonly code: "CONFIGURATION_ERROR" = "CONFIGURATION_ERROR";

```

Error code for programmatic error handling

#### Overrides[​](#overrides "Direct link to Overrides")

[`AppKitError`](/appkit/docs/api/appkit/Class.AppKitError.md).[`code`](/appkit/docs/api/appkit/Class.AppKitError.md#code)

***

### context?[​](#context "Direct link to context?")

```ts
readonly optional context: Record<string, unknown>;

```

Additional context for the error

#### Inherited from[​](#inherited-from-2 "Direct link to Inherited from")

[`AppKitError`](/appkit/docs/api/appkit/Class.AppKitError.md).[`context`](/appkit/docs/api/appkit/Class.AppKitError.md#context)

***

### isRetryable[​](#isretryable "Direct link to isRetryable")

```ts
readonly isRetryable: false = false;

```

Whether this error type is generally safe to retry

#### Overrides[​](#overrides-1 "Direct link to Overrides")

[`AppKitError`](/appkit/docs/api/appkit/Class.AppKitError.md).[`isRetryable`](/appkit/docs/api/appkit/Class.AppKitError.md#isretryable)

***

### statusCode[​](#statuscode "Direct link to statusCode")

```ts
readonly statusCode: 500 = 500;

```

HTTP status code suggestion (can be overridden)

#### Overrides[​](#overrides-2 "Direct link to Overrides")

[`AppKitError`](/appkit/docs/api/appkit/Class.AppKitError.md).[`statusCode`](/appkit/docs/api/appkit/Class.AppKitError.md#statuscode)

## Methods[​](#methods "Direct link to Methods")

### toJSON()[​](#tojson "Direct link to toJSON()")

```ts
toJSON(): Record<string, unknown>;

```

Convert error to JSON for logging/serialization. Sensitive values in context are automatically redacted.

#### Returns[​](#returns-1 "Direct link to Returns")

`Record`<`string`, `unknown`>

#### Inherited from[​](#inherited-from-3 "Direct link to Inherited from")

[`AppKitError`](/appkit/docs/api/appkit/Class.AppKitError.md).[`toJSON`](/appkit/docs/api/appkit/Class.AppKitError.md#tojson)

***

### toString()[​](#tostring "Direct link to toString()")

```ts
toString(): string;

```

Create a human-readable string representation

#### Returns[​](#returns-2 "Direct link to Returns")

`string`

#### Inherited from[​](#inherited-from-4 "Direct link to Inherited from")

[`AppKitError`](/appkit/docs/api/appkit/Class.AppKitError.md).[`toString`](/appkit/docs/api/appkit/Class.AppKitError.md#tostring)

***

### invalidConnection()[​](#invalidconnection "Direct link to invalidConnection()")

```ts
static invalidConnection(service: string, details?: string): ConfigurationError;

```

Create a configuration error for invalid connection config

#### Parameters[​](#parameters-1 "Direct link to Parameters")

| Parameter  | Type     |
| ---------- | -------- |
| `service`  | `string` |
| `details?` | `string` |

#### Returns[​](#returns-3 "Direct link to Returns")

`ConfigurationError`

***

### missingConnectionParam()[​](#missingconnectionparam "Direct link to missingConnectionParam()")

```ts
static missingConnectionParam(param: string): ConfigurationError;

```

Create a configuration error for missing connection string parameter

#### Parameters[​](#parameters-2 "Direct link to Parameters")

| Parameter | Type     |
| --------- | -------- |
| `param`   | `string` |

#### Returns[​](#returns-4 "Direct link to Returns")

`ConfigurationError`

***

### missingEnvVar()[​](#missingenvvar "Direct link to missingEnvVar()")

```ts
static missingEnvVar(varName: string): ConfigurationError;

```

Create a configuration error for missing environment variable

#### Parameters[​](#parameters-3 "Direct link to Parameters")

| Parameter | Type     |
| --------- | -------- |
| `varName` | `string` |

#### Returns[​](#returns-5 "Direct link to Returns")

`ConfigurationError`

***

### resourceNotFound()[​](#resourcenotfound "Direct link to resourceNotFound()")

```ts
static resourceNotFound(resource: string, hint?: string): ConfigurationError;

```

Create a configuration error for missing resource

#### Parameters[​](#parameters-4 "Direct link to Parameters")

| Parameter  | Type     |
| ---------- | -------- |
| `resource` | `string` |
| `hint?`    | `string` |

#### Returns[​](#returns-6 "Direct link to Returns")

`ConfigurationError`
