Skip to main content

Class: ConfigurationError

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

Constructors

Constructor

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

Parameters

ParameterType
messagestring
options?{ cause?: Error; clientMessage?: string; context?: Record<string, unknown>; }
options.cause?Error
options.clientMessage?string
options.context?Record<string, unknown>

Returns

ConfigurationError

Inherited from

AppKitError.constructor

Properties

_clientMessage?

protected readonly optional _clientMessage: string;

Client-safe error message. When set, callers serializing the error to a client (SSE, HTTP body) MUST prefer clientMessage over messagemessage may contain raw upstream / SDK text including statement fragments, internal object names, and correlation IDs.

Subclasses can set this in their constructor for a fixed sanitized string. When unset, clientMessage defaults to a generic per-code string (see the getter), and the raw message is kept server-side only.

Inherited from

AppKitError._clientMessage


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

Accessors

clientMessage

Get Signature

get clientMessage(): string;

Sanitized message safe to forward to clients. Override in subclasses if a more specific default is appropriate.

Returns

string

Inherited from

AppKitError.clientMessage

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


databricksAuthenticationSetupFailed()

static databricksAuthenticationSetupFailed(detail: string, options?: {
  cause?: Error;
}): ConfigurationError;

Databricks CLI / token auth failed while creating the workspace client.

By default the message is short; key lines use picocolors when the terminal supports it (also respects NO_COLOR). console.error won’t show stacks or { code, context, … }. Set APPKIT_VERBOSE_AUTH_ERRORS=1 for full cause, stack, and the raw SDK message (verbose appendix is unstyled).

Parameters

ParameterType
detailstring
options?{ cause?: Error; }
options.cause?Error

Returns

ConfigurationError


invalidConnection()

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

Create a configuration error for invalid connection config

Parameters

ParameterType
servicestring
details?string

Returns

ConfigurationError


missingConnectionParam()

static missingConnectionParam(param: string): ConfigurationError;

Create a configuration error for missing connection string parameter

Parameters

ParameterType
paramstring

Returns

ConfigurationError


missingEnvVar()

static missingEnvVar(varName: string): ConfigurationError;

Create a configuration error for missing environment variable

Parameters

ParameterType
varNamestring

Returns

ConfigurationError


resourceNotFound()

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

Create a configuration error for missing resource

Parameters

ParameterType
resourcestring
hint?string

Returns

ConfigurationError

Databricks Developer Hub

Ready to ship your next agentic app in minutes?

Read docs