Skip to main content

Class: PluginPermissionError

Defined in: src/types/errors.ts:472

Plugin permission denied error.

Remarks​

Thrown when a plugin attempts to access a resource or perform an action that it does not have permission for. Permissions must be declared in the plugin manifest.

Example​

// Plugin tries to access undeclared domain
throw new PluginPermissionError(
'com.example.plugin',
'network:api.unauthorized.com'
);

Extends​

Constructors​

new PluginPermissionError()​

new PluginPermissionError(pluginId, permission): PluginPermissionError

Defined in: src/types/errors.ts:493

Creates a new PluginPermissionError.

Parameters​

pluginId​

string

ID of the plugin that violated permissions

permission​

string

Permission that was required but not granted

Returns​

PluginPermissionError

Overrides​

ChiveError.constructor

Properties​

cause?​

readonly optional cause: Error

Defined in: src/types/errors.ts:71

Original error that caused this error (if any).

Remarks​

Error chaining allows tracking the full error context through multiple layers of the application. Useful for debugging complex error scenarios.

Example​

try {
await fetchData();
} catch (err) {
throw new ValidationError('Failed to validate data', 'field', 'required', err as Error);
}

Inherited from​

ChiveError.cause


code​

readonly code: "PLUGIN_PERMISSION_DENIED" = 'PLUGIN_PERMISSION_DENIED'

Defined in: src/types/errors.ts:473

Machine-readable error code.

Remarks​

Error codes are unique identifiers for error types, enabling programmatic error handling (switch statements, error maps), error tracking in monitoring systems, and client-side error translation (i18n).

Overrides​

ChiveError.code


permission​

readonly permission: string

Defined in: src/types/errors.ts:485

Permission that was required but not granted.

Example​

'network:api.github.com', 'hook:eprint.indexed', 'storage:write'

pluginId​

readonly pluginId: string

Defined in: src/types/errors.ts:478

ID of the plugin that violated permissions.