Skip to content

NOT_EMPTY_DIRECTORY_ERROR_CODE

The code carried by the error thrown when a non-recursive rmdir is refused because the folder has children.

Matches the POSIX/Node error code a correct non-recursive directory removal produces, so a caller already branching on error.code keeps working. Check the code, never instanceof — every plugin bundles its own copy of this library, so the error may cross a copy boundary.

Import:

import { NOT_EMPTY_DIRECTORY_ERROR_CODE } from 'obsidian-dev-utils/obsidian/components/rmdir-guard-component';

Signature:

const NOT_EMPTY_DIRECTORY_ERROR_CODE: "ENOTEMPTY"

Type: “ENOTEMPTY”


Links to this page: