Class: TRPCClientError<TRouterOrProcedure>
Extends
Error
Type Parameters
Type Parameter |
---|
TRouterOrProcedure extends InferrableClientTypes |
Implements
TRPCClientErrorBase
<inferErrorShape
<TRouterOrProcedure
>>
Constructors
new TRPCClientError()
new TRPCClientError<
TRouterOrProcedure
>(message
,opts
?):TRPCClientError
<TRouterOrProcedure
>
Parameters
Parameter | Type |
---|---|
message | string |
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
Defined in
packages/client/src/TRPCClientError.ts:60
message
message:
string
Implementation of
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
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
Parameter | Type |
---|---|
err | Error |
stackTraces | CallSite [] |
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
Parameter | Type |
---|---|
targetObject | object |
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
Parameter | Type |
---|---|
_cause | object | Error | TRPCErrorResponse <any > |
opts | object |
opts.meta ? | Record <string , unknown > |
Returns
TRPCClientError
<TRouterOrProcedure
>