Skip to main content
Version: next

Class: ProxyError

Defined in: src/errors/ProxyError.ts:12

Represents an error that occurs within a proxy. This error class extends the built-in Error class and adds a proxy property to track the proxy associated with the error. It also triggers custom events when the error is created.

Example​

const proxyError = new ProxyError('An error occurred with the proxy', someProxyInstance);

Extends​

  • Error

Implements​

  • ProxyError

Constructors​

new ProxyError()​

new ProxyError(message, proxy): ProxyError

Defined in: src/errors/ProxyError.ts:31

Creates an instance of the ProxyError.

This constructor not only initializes the error message but also emits custom events on the associated proxy's nexo event emitter and a separate wrapper event emitter.

Parameters​

message​

string

The error message to be associated with this error.

proxy​

Proxy

The proxy instance that is the source of the error.

Returns​

ProxyError

Example​

const proxyError = new ProxyError('An error occurred with the proxy', someProxyInstance);
// This will emit 'proxy.error' events on both the proxy's nexo emitter and wrapper.

Overrides​

Error.constructor

Properties​

name​

readonly name: "ProxyError" = "ProxyError"

Defined in: src/errors/ProxyError.ts:13

Implementation of​

nx.ProxyError.name

Overrides​

Error.name


proxy​

readonly proxy: Proxy

Defined in: src/errors/ProxyError.ts:16

The proxy instance associated with this error.

Implementation of​

nx.ProxyError.proxy