Skip to main content

Class: StackLockedError

Defined in: packages/client/src/plugins/pouchdb.ts:29

Raised when a locked stack is asked to write a class carrying encrypted attributes.

A stack is locked when encryption is enabled but no document key has been supplied. Writing then would store the encrypted fields as plaintext, so the write is refused.

Example

try {
await secretClass.addCard({ ssn: "..." });
} catch (error) {
error instanceof StackLockedError; // true - call stack.unlock(key) first
}

Extends

  • Error

Constructors

Constructor

new StackLockedError(className, scopeId?): StackLockedError;

Defined in: packages/client/src/plugins/pouchdb.ts:36

Parameters

ParameterType
classNamestring
scopeId?string

Returns

StackLockedError

Overrides

Error.constructor

Properties

PropertyModifierTypeDefault valueDescriptionOverridesDefined in
classNamereadonlystringundefinedThe class the refused document belongs to.-packages/client/src/plugins/pouchdb.ts:32
namepublicstring"StackLockedError"-Error.namepackages/client/src/plugins/pouchdb.ts:30
scopeId?readonlystringundefinedThe sealed scope, when the refusal is a scope's rather than the legacy key's (ADR-0045).-packages/client/src/plugins/pouchdb.ts:34