Skip to main content
Version: Next

Class: RpcError<BaseErrorT>

Type parameters​

NameType
BaseErrorTextends RPC_ERROR = RPC_ERROR

Hierarchy​

Constructors​

constructor​

• new RpcError<BaseErrorT>(baseError, method, params): RpcError<BaseErrorT>

Type parameters​

NameType
BaseErrorTextends RPC_ERROR = RPC_ERROR

Parameters​

NameType
baseErrorBaseErrorT
methodstring
paramsany

Returns​

RpcError<BaseErrorT>

Overrides​

LibraryError.constructor

Defined in​

src/utils/errors/index.ts:50

Properties​

prepareStackTrace​

â–ª Static Optional prepareStackTrace: (err: Error, stackTraces: CallSite[]) => any

Type declaration​

â–¸ (err, stackTraces): any

Optional override for formatting stack traces

Parameters​
NameType
errError
stackTracesCallSite[]
Returns​

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from​

LibraryError.prepareStackTrace

Defined in​

node_modules/@types/node/globals.d.ts:74


stackTraceLimit​

â–ª Static stackTraceLimit: number

Inherited from​

LibraryError.stackTraceLimit

Defined in​

node_modules/@types/node/globals.d.ts:76


request​

• Readonly request: Object

Type declaration​

NameType
methodstring
paramsany

Defined in​

src/utils/errors/index.ts:45


baseError​

• Readonly baseError: BaseErrorT

Defined in​

src/utils/errors/index.ts:51


name​

• name: string

Inherited from​

LibraryError.name

Defined in​

src/utils/errors/index.ts:21


message​

• message: string

Inherited from​

LibraryError.message

Defined in​

www/node_modules/typescript/lib/lib.es5.d.ts:1055


stack​

• Optional stack: string

Inherited from​

LibraryError.stack

Defined in​

www/node_modules/typescript/lib/lib.es5.d.ts:1056


cause​

• Optional cause: unknown

Inherited from​

LibraryError.cause

Defined in​

www/node_modules/typescript/lib/lib.es2022.error.d.ts:24

Accessors​

code​

• get code(): 1 | 32 | 10 | 20 | 24 | 27 | 28 | 29 | 31 | 33 | 34 | 40 | 41 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63

Returns​

1 | 32 | 10 | 20 | 24 | 27 | 28 | 29 | 31 | 33 | 34 | 40 | 41 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63

Defined in​

src/utils/errors/index.ts:62

Methods​

captureStackTrace​

â–¸ captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

Parameters​

NameType
targetObjectobject
constructorOpt?Function

Returns​

void

Inherited from​

LibraryError.captureStackTrace

Defined in​

node_modules/@types/node/globals.d.ts:67


isType​

â–¸ isType<N, C>(typeName): this is RpcError<RPC_ERROR_SET[N] & Object>

Verifies the underlying RPC error, also serves as a type guard for the baseError property

Type parameters​

NameType
Nextends keyof RPC_ERROR_SET
Cextends 1 | 32 | 10 | 20 | 24 | 27 | 28 | 29 | 31 | 33 | 34 | 40 | 41 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63

Parameters​

NameType
typeNameN

Returns​

this is RpcError<RPC_ERROR_SET[N] & Object>

Example

SomeError.isType('UNEXPECTED_ERROR');

Defined in​

src/utils/errors/index.ts:73