/** @packageDocumentation * @module iModels */ import { GuidString, ITwinError } from "@itwin/core-bentley"; /** * An error originating from the [SQLiteDb]($backend) API. * @beta */ export interface SqliteError extends ITwinError { /** The name of the database for this problem. */ dbName: string; } /** @beta */ export declare namespace SqliteError { const scope = "itwin-Sqlite"; type Key = "already-open" | "incompatible-version" | "invalid-versions-property" | "readonly"; /** Determine whether an error object is a SqliteError */ function isError(error: unknown, key?: Key): error is SqliteError; /** Instantiate and throw a SqliteError */ function throwError(key: Key, message: string, dbName: string): never; } /** * An error originating from the [CloudSqlite]($backend) API. * @beta */ export interface CloudSqliteError extends ITwinError { /** The name of the database that generated the error */ readonly dbName?: string; /** The name of the container associated with the error */ readonly containerId?: string; } /** @beta */ export declare namespace CloudSqliteError { const scope = "itwin-CloudSqlite"; type Key = "already-published" | "copy-error" | "invalid-name" | "no-version-available" | "not-a-function" | "service-not-available" | /** The write lock cannot be acquired because it is currently held by somebody else. * @see WriteLockHeld for details */ "write-lock-held" | /** The write lock on a container is not held, but is required for this operation */ "write-lock-not-held"; /** thrown when an attempt to acquire the write lock for a container fails because the lock is already held by somebody else ("write-lock-held"). */ interface WriteLockHeld extends CloudSqliteError { /** @internal */ errorNumber: number; /** moniker of user currently holding container's lock */ lockedBy: string; /** time the lock expires */ expires: string; } /** Determine whether an error object is a CloudSqliteError */ function isError(error: unknown, key?: Key): error is T; /** Instantiate and throw a CloudSqliteError */ function throwError(key: Key, e: Omit): never; } /** Errors thrown by the [ViewStore]($backend) API. * @beta */ export interface ViewStoreError extends ITwinError { /** The name of the ViewStore that generated the error */ viewStoreName?: string; } /** @beta */ export declare namespace ViewStoreError { const scope = "itwin-ViewStore"; type Key = "invalid-value" | "invalid-member" | "no-owner" | "not-found" | "not-unique" | "no-viewstore" | "group-error"; /** Determine whether an error object is a ViewStoreError */ function isError(error: unknown, key?: Key): error is T; /** Instantiate and throw a ViewStoreError */ function throwError(key: Key, e: Omit): never; } /** * Errors thrown by the [Workspace]($backend) APIs. * @beta */ export declare namespace WorkspaceError { const scope = "itwin-Workspace"; type Key = "already-exists" | "container-exists" | "does-not-exist" | "invalid-name" | "no-cloud-container" | "load-error" | "load-errors" | "resource-exists" | "too-large" | "write-error"; /** Determine whether an error object is a WorkspaceError */ function isError(error: unknown, key?: Key): error is T; function throwError(key: Key, e: Omit): never; } /** * Errors thrown by iTwin settings container APIs. * @beta */ export interface ITwinSettingsError extends ITwinError { /** The iTwin associated with this settings error, when available. */ readonly iTwinId?: GuidString; /** The priority associated with this settings error, when available. */ readonly priority?: number; } /** @beta */ export declare namespace ITwinSettingsError { const scope = "itwin-settings"; type Key = "failed-to-obtain-container-token" | "multiple-itwin-settings-containers" | "no-cloud-container" | "blob-service-unavailable" | "invalid-priority" | "unknown-setting"; /** Determine whether an error object is an ITwinSettingsError. */ function isError(error: unknown, key?: Key): error is ITwinSettingsError; /** Instantiate and throw an ITwinSettingsError. */ function throwError(key: Key, e: Omit): never; } /** Errors originating from the [ChannelControl]($backend) interface. * @beta */ export interface ChannelControlError extends ITwinError { /** The channel key that caused the error. */ readonly channelKey: string; } /** @beta */ export declare namespace ChannelControlError { /** the ITwinError scope for `ChannelControlError`s. */ const scope = "itwin-ChannelControl"; /** Keys that identify `ChannelControlError`s */ type Key = /** an attempt to create a channel within an existing channel */ "may-not-nest" | /** an attempt to use a channel that was not "allowed" */ "not-allowed" | /** the root channel already exists */ "root-exists"; /** Instantiate and throw a ChannelControlError */ function throwError(key: Key, message: string, channelKey: string): never; /** Determine whether an error object is a ChannelControlError */ function isError(error: unknown, key?: Key): error is ChannelControlError; } /** * An error originating from the [EditTxn]($backend) API. * @beta */ export interface EditTxnError extends ITwinError { /** The iModel key associated with the error. */ readonly iModelKey?: string; /** The description of the EditTxn that caused the error, if applicable. */ readonly description?: string; } /** @beta */ export declare namespace EditTxnError { /** the ITwinError scope for `EditTxnError`s. */ const scope = "itwin-EditTxn"; /** Keys that identify `EditTxnError`s */ type Key = /** an attempt to start an EditTxn when one is already active */ "already-active" | /** an attempt to modify an iModel through the implicit transaction when explicit transactions are enforced */ "implicit-txn-write-disallowed" | /** an attempt to start an EditTxn when unsaved changes are already present */ "unsaved-changes" | /** an attempt to perform an operation that requires an active EditTxn when none is active */ "not-active" | /** an attempt to use an EditTxn with the wrong iModel */ "wrong-imodel"; /** Instantiate and throw an EditTxnError */ function throwError(key: Key, message: string, iModelKey?: string, description?: string): never; /** Determine whether an error object is an EditTxnError */ function isError(error: unknown, key?: Key): error is EditTxnError; } /** Errors originating from the server-based implementation of the [LockControl]($backend) interface. * @beta */ export declare namespace ServerBasedLocksError { /** the ITwinError scope for `ServerBasedLocksError`s. */ const scope = "itwin-ServerBasedLocks"; /** Keys that identify `ServerBasedLocksError`s */ type Key = /** The briefcase contains unsaved changes */ "has-unsaved-changes" | /** A SQLite error occurred while reading or writing the "locks" database */ "lock-database-problem" | /** The specified Txn ID is not known to the TxnManager */ "txn-id-not-found" | /** Attempted to abandon locks for a Txn that has not yet been reversed */ "txn-not-reversed"; /** Instantiate and throw a ServerBasedLocksError */ function throwError(key: Key, message: string): never; /** Determine whether an error object is a ServerBasedLocksError */ function isError(error: unknown, key?: Key): error is ITwinError; } //# sourceMappingURL=ITwinCoreErrors.d.ts.map