Skip to main content
Version: 11.x

Class: TRPCClientError<TRouterOrProcedure>

Extends

  • Error

Type Parameters

Type Parameter
TRouterOrProcedure extends InferrableClientTypes

Implements

Constructors

new TRPCClientError()

new TRPCClientError<TRouterOrProcedure>(message, opts?): TRPCClientError<TRouterOrProcedure>

Parameters

ParameterType
messagestring
opts?object
opts.cause?Error
opts.meta?Record<string, unknown>
opts.result?Maybe<TRPCErrorResponse<inferErrorShape<TRouterOrProcedure>>>

Returns

TRPCClientError<TRouterOrProcedure>

Overrides

Error.constructor

Defined in

packages/client/src/TRPCClientError.ts:68

Properties

cause

readonly cause: undefined | Error

Overrides

Error.cause

Defined in

packages/client/src/TRPCClientError.ts:58


data

readonly data: Maybe<inferErrorShape<TRouterOrProcedure>["data"]>

Implementation of

TRPCClientErrorBase.data

Defined in

packages/client/src/TRPCClientError.ts:60


message

message: string

Implementation of

TRPCClientErrorBase.message

Inherited from

Error.message

Defined in

node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es5.d.ts:1068


meta

meta: undefined | Record<string, unknown>

Additional meta data about the error In the case of HTTP-errors, we'll have response and potentially responseJSON here

Defined in

packages/client/src/TRPCClientError.ts:66


name

name: string

Inherited from

Error.name

Defined in

node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es5.d.ts:1067


shape

readonly shape: Maybe<inferErrorShape<TRouterOrProcedure>>

Implementation of

TRPCClientErrorBase.shape

Defined in

packages/client/src/TRPCClientError.ts:59


stack?

optional stack: string

Inherited from

Error.stack

Defined in

node_modules/.pnpm/typescript@5.1.6/node_modules/typescript/lib/lib.es5.d.ts:1069


prepareStackTrace()?

static optional prepareStackTrace: (err, stackTraces) => any

Optional override for formatting stack traces

Parameters

ParameterType
errError
stackTracesCallSite[]

Returns

any

See

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

Inherited from

Error.prepareStackTrace

Defined in

node_modules/.pnpm/@types+node@20.17.10/node_modules/@types/node/globals.d.ts:98


stackTraceLimit

static stackTraceLimit: number

Inherited from

Error.stackTraceLimit

Defined in

node_modules/.pnpm/@types+node@20.17.10/node_modules/@types/node/globals.d.ts:100

Methods

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

Parameters

ParameterType
targetObjectobject
constructorOpt?Function

Returns

void

Inherited from

Error.captureStackTrace

Defined in

node_modules/.pnpm/@types+node@20.17.10/node_modules/@types/node/globals.d.ts:91


from()

static from<TRouterOrProcedure>(_cause, opts): TRPCClientError<TRouterOrProcedure>

Type Parameters

Type Parameter
TRouterOrProcedure extends InferrableClientTypes

Parameters

ParameterType
_causeobject | Error | TRPCErrorResponse<any>
optsobject
opts.meta?Record<string, unknown>

Returns

TRPCClientError<TRouterOrProcedure>

Defined in

packages/client/src/TRPCClientError.ts:92