Skip to main content
⚠️ AppKit is in an early development phase and is subject to change without notice. DO NOT use in production environments.

# Class: ConfigurationError

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

## Example​

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

## Extends​

- `AppKitError`

## Constructors​

### Constructor​

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

#### Parameters​

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

#### Returns​

`ConfigurationError`

#### Inherited from​

`AppKitError`.`constructor`

## Properties​

### cause?​

    readonly optional cause: Error;

Optional cause of the error

#### Inherited from​

`AppKitError`.`cause`

### code​

    readonly code: "CONFIGURATION_ERROR" = "CONFIGURATION_ERROR";

Error code for programmatic error handling

#### Overrides​

`AppKitError`.`code`

### context?​

    readonly optional context: Record<string, unknown>;

Additional context for the error

#### Inherited from​

`AppKitError`.`context`

### isRetryable​

    readonly isRetryable: false = false;

Whether this error type is generally safe to retry

#### Overrides​

`AppKitError`.`isRetryable`

### statusCode​

    readonly statusCode: 500 = 500;

HTTP status code suggestion (can be overridden)

#### Overrides​

`AppKitError`.`statusCode`

## Methods​

### toJSON()​

    toJSON(): Record<string, unknown>;

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

#### Returns​

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

#### Inherited from​

`AppKitError`.`toJSON`

### toString()​

    toString(): string;

Create a human-readable string representation

#### Returns​

`string`

#### Inherited from​

`AppKitError`.`toString`

### invalidConnection()​

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

Create a configuration error for invalid connection config

#### Parameters​

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

#### Returns​

`ConfigurationError`

### missingConnectionParam()​

    static missingConnectionParam(param: string): ConfigurationError;

Create a configuration error for missing connection string parameter

#### Parameters​

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

#### Returns​

`ConfigurationError`

### missingEnvVar()​

    static missingEnvVar(varName: string): ConfigurationError;

Create a configuration error for missing environment variable

#### Parameters​

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

#### Returns​

`ConfigurationError`

### resourceNotFound()​

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

Create a configuration error for missing resource

#### Parameters​

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

#### Returns​

`ConfigurationError`