Skip to main content

Class: PluginError

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

Plugin error for general plugin failures.

Remarks

Thrown when plugin operations fail, including loading, initialization, execution, or shutdown. Includes the plugin ID and operation for debugging.

Example

throw new PluginError(
'com.example.github',
'INITIALIZE',
'Failed to connect to GitHub API'
);

Extends

Constructors

new PluginError()

new PluginError(pluginId, operation, message, cause?): PluginError

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

Creates a new PluginError.

Parameters

pluginId

string

ID of the plugin that failed

operation

PluginOperation

Operation being performed ('LOAD', 'INITIALIZE', 'EXECUTE', 'SHUTDOWN')

message

string

Description of the failure

cause?

Error

Original error (if chained)

Returns

PluginError

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_ERROR" = 'PLUGIN_ERROR'

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

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


operation

readonly operation: PluginOperation

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

Operation that was being performed when the error occurred.


pluginId

readonly pluginId: string

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

ID of the plugin that failed.