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
| Parameter | Type |
|---|---|
className | string |
scopeId? | string |
Returns
StackLockedError
Overrides
Error.constructor
Properties
| Property | Modifier | Type | Default value | Description | Overrides | Defined in |
|---|---|---|---|---|---|---|
className | readonly | string | undefined | The class the refused document belongs to. | - | packages/client/src/plugins/pouchdb.ts:32 |
name | public | string | "StackLockedError" | - | Error.name | packages/client/src/plugins/pouchdb.ts:30 |
scopeId? | readonly | string | undefined | The sealed scope, when the refusal is a scope's rather than the legacy key's (ADR-0045). | - | packages/client/src/plugins/pouchdb.ts:34 |