tryError Documentation

Class: PluginManager
Class

Defined in: [plugins.ts:98](https://github.com/oconnorjohnson/try-error/blob/e3ae0308069a4fba073f4543d527ad76373db795/src/plugins.ts#L98) Plugin manager

tryError API Documentation v0.0.1-alpha.1


tryError API Documentation / PluginManager

Class: PluginManager

Defined in: plugins.ts:98

Plugin manager

Constructors

Constructor

new PluginManager(): PluginManager;

Returns

PluginManager

Methods

disable()

disable(name): Promise<void>;

Defined in: plugins.ts:201

Disable a plugin

Parameters

name

string

Returns

Promise<void>


enable()

enable(name): Promise<void>;

Defined in: plugins.ts:171

Enable a plugin

Parameters

name

string

Returns

Promise<void>


get()

get(name): undefined | Plugin;

Defined in: plugins.ts:250

Get a specific plugin

Parameters

name

string

Returns

undefined | Plugin


getAllErrorTypes()

getAllErrorTypes(): Record<string, (message, context?) => TryError>;

Defined in: plugins.ts:314

Get all custom error types from enabled plugins

Returns

Record<string, (message, context?) => TryError>


getAllMiddleware()

getAllMiddleware(): ErrorMiddleware[];

Defined in: plugins.ts:296

Get all middleware from enabled plugins

Returns

ErrorMiddleware[]


getAllUtilities()

getAllUtilities(): Record<string, Function>;

Defined in: plugins.ts:338

Get all utilities from enabled plugins

Returns

Record<string, Function>


getEnabled()

getEnabled(): PluginMetadata[];

Defined in: plugins.ts:241

Get all enabled plugins

Returns

PluginMetadata[]


getInstalled()

getInstalled(): PluginMetadata[];

Defined in: plugins.ts:234

Get all installed plugins

Returns

PluginMetadata[]


getMergedConfig()

getMergedConfig(): Partial<TryErrorConfig>;

Defined in: plugins.ts:271

Get merged configuration from all enabled plugins

Returns

Partial<TryErrorConfig>


install()

install(plugin): Promise<void>;

Defined in: plugins.ts:106

Install a plugin

Parameters

plugin

Plugin

Returns

Promise<void>


isEnabled()

isEnabled(name): boolean;

Defined in: plugins.ts:264

Check if a plugin is enabled

Parameters

name

string

Returns

boolean


isInstalled()

isInstalled(name): boolean;

Defined in: plugins.ts:257

Check if a plugin is installed

Parameters

name

string

Returns

boolean


notifyConfigChange()

notifyConfigChange(config): Promise<void>;

Defined in: plugins.ts:356

Notify all plugins of a configuration change

Parameters

config

TryErrorConfig

Returns

Promise<void>


uninstall()

uninstall(name): Promise<void>;

Defined in: plugins.ts:137

Uninstall a plugin

Parameters

name

string

Returns

Promise<void>