Skip to content

ResourceLockedError

Thrown by the vault-mutation blocker when a plugin tries to edit, delete, rename, move, or create a resource whose path is covered by a lock taken with ResourceLockComponentLockForPathParams.shouldBlockMutations.

instanceof ResourceLockedError is structural: it matches any error named ResourceLockedError that carries a string path, whichever copy of this library threw it. The blocker belongs to the realm-wide lock manager in the shared-state bag, and that manager is built by whichever copy of the library touched it first, so the error a plugin catches is often another plugin’s class.

Import:

import { ResourceLockedError } from '@mnaoumov/obsidian-lib/resource-lock';

Signature:

export class ResourceLockedError extends Error

Extends: Error

Constructor

new ResourceLockedError(path: string)

Creates a ResourceLockedError.

Properties

PropertyTypeDescription
pathstringThe vault path whose mutation was blocked.

Methods

MethodReturnsDescription
static [Symbol.hasInstance](instance)booleanMatches a ResourceLockedError thrown by any copy of this library, by its name and path. A subclass keeps the ordinary prototype check.

Links to this page: