chore: initial commit
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
export type PluginErrorReason = 'INVALID_CONFIG' | 'ALREADY_INSTALLED' | 'NOT_INSTALLED'
|
||||
| 'MANAGER_DISPOSED' | 'LOAD_FAILED' | 'INIT_FAILED' | 'DISPOSE_FAILED';
|
||||
|
||||
export class PluginError extends Error {
|
||||
constructor(readonly reason: PluginErrorReason) {
|
||||
super({
|
||||
INVALID_CONFIG: 'Invalid plugin config', ALREADY_INSTALLED: 'Duplicate plugin',
|
||||
NOT_INSTALLED: 'Plugin not installed', MANAGER_DISPOSED: 'Plugin manager disposed',
|
||||
LOAD_FAILED: 'Plugin load failed', INIT_FAILED: 'Plugin initialization failed',
|
||||
DISPOSE_FAILED: 'Plugin disposal failed',
|
||||
}[reason]);
|
||||
this.name = 'PluginError';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user