ErrorCode
Defined in: src/enums/ErrorCode.ts:8
Stable, machine-readable codes attached to every AccessControlError
(err.code). Branch on these instead of parsing message strings — messages
are redacted by default (engine.safeErrors) and may change wording, but
codes are part of the public contract.
Enumeration Members
Section titled “Enumeration Members”INVALID_NAME
Section titled “INVALID_NAME”INVALID_NAME:
"INVALID_NAME"
Defined in: src/enums/ErrorCode.ts:10
A name (role/resource/action/group/category) is empty or malformed.
RESERVED_NAME
Section titled “RESERVED_NAME”RESERVED_NAME:
"RESERVED_NAME"
Defined in: src/enums/ErrorCode.ts:12
A name is a reserved prototype-pollution keyword (__proto__, …).
INVALID_QUERY
Section titled “INVALID_QUERY”INVALID_QUERY:
"INVALID_QUERY"
Defined in: src/enums/ErrorCode.ts:14
A check query (IQueryInfo passed to can/check) is malformed.
INVALID_GRANT
Section titled “INVALID_GRANT”INVALID_GRANT:
"INVALID_GRANT"
Defined in: src/enums/ErrorCode.ts:16
A grant rule / grants object / IAccessInfo has an invalid shape.
INVALID_SETUP
Section titled “INVALID_SETUP”INVALID_SETUP:
"INVALID_SETUP"
Defined in: src/enums/ErrorCode.ts:18
The setup() vocabulary object is malformed.
INVALID_ACTION
Section titled “INVALID_ACTION”INVALID_ACTION:
"INVALID_ACTION"
Defined in: src/enums/ErrorCode.ts:20
An action name or possession is invalid.
ROLE_NOT_FOUND
Section titled “ROLE_NOT_FOUND”ROLE_NOT_FOUND:
"ROLE_NOT_FOUND"
Defined in: src/enums/ErrorCode.ts:22
A referenced role does not exist.
INVALID_INHERITANCE
Section titled “INVALID_INHERITANCE”INVALID_INHERITANCE:
"INVALID_INHERITANCE"
Defined in: src/enums/ErrorCode.ts:24
Inheritance is invalid (self-extend, cross-inheritance, non-existent).
UNKNOWN_ACTION
Section titled “UNKNOWN_ACTION”UNKNOWN_ACTION:
"UNKNOWN_ACTION"
Defined in: src/enums/ErrorCode.ts:26
strict.actions: the checked action is not in the known set.
UNKNOWN_RESOURCE
Section titled “UNKNOWN_RESOURCE”UNKNOWN_RESOURCE:
"UNKNOWN_RESOURCE"
Defined in: src/enums/ErrorCode.ts:28
strict.resources: the checked resource is not in the known set.
LOCKED
Section titled “LOCKED”LOCKED:
"LOCKED"
Defined in: src/enums/ErrorCode.ts:30
A mutation was attempted after lock().
ASYNC_REQUIRED
Section titled “ASYNC_REQUIRED”ASYNC_REQUIRED:
"ASYNC_REQUIRED"
Defined in: src/enums/ErrorCode.ts:32
The check needs the async path (a custom/async { fn } condition).
INVALID_CONDITION
Section titled “INVALID_CONDITION”INVALID_CONDITION:
"INVALID_CONDITION"
Defined in: src/enums/ErrorCode.ts:34
A condition is malformed, uncompiled, or nested too deep.
UNKNOWN_CONDITION_FN
Section titled “UNKNOWN_CONDITION_FN”UNKNOWN_CONDITION_FN:
"UNKNOWN_CONDITION_FN"
Defined in: src/enums/ErrorCode.ts:36
A custom condition function name is not registered.
REGEX_DISABLED
Section titled “REGEX_DISABLED”REGEX_DISABLED:
"REGEX_DISABLED"
Defined in: src/enums/ErrorCode.ts:38
The matches operator is disabled (engine.allowRegex is off).
UNSAFE_REGEX
Section titled “UNSAFE_REGEX”UNSAFE_REGEX:
"UNSAFE_REGEX"
Defined in: src/enums/ErrorCode.ts:40
A regular expression is malformed or potentially catastrophic.