Skip to main content
Version: 10.x

Class: TRPCError

Extends

  • Error

Constructors

constructor()

new TRPCError(opts): TRPCError

Parameters

ParameterType
optsobject
opts.cause?unknown
opts.code"PARSE_ERROR" | "BAD_REQUEST" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "UNAUTHORIZED" | "FORBIDDEN" | "NOT_FOUND" | "METHOD_NOT_SUPPORTED" | "TIMEOUT" | "CONFLICT" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "UNPROCESSABLE_CONTENT" | "TOO_MANY_REQUESTS" | "CLIENT_CLOSED_REQUEST"
opts.message?string

Returns

TRPCError

Overrides

Error.constructor

Source

packages/server/src/error/TRPCError.ts:61

Properties

cause

optional readonly cause: Error

Source

packages/server/src/error/TRPCError.ts:58

Overrides

Error.cause


code

readonly code: "PARSE_ERROR" | "BAD_REQUEST" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "UNAUTHORIZED" | "FORBIDDEN" | "NOT_FOUND" | "METHOD_NOT_SUPPORTED" | "TIMEOUT" | "CONFLICT" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "UNPROCESSABLE_CONTENT" | "TOO_MANY_REQUESTS" | "CLIENT_CLOSED_REQUEST"

Source

packages/server/src/error/TRPCError.ts:59


message

message: string

Source

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

Inherited from

Error.message


name

name: string

Source

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

Inherited from

Error.name


stack

optional stack: string

Source

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

Inherited from

Error.stack


prepareStackTrace

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

Optional override for formatting stack traces

See

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

Parameters

ParameterType
errError
stackTracesCallSite[]

Returns

any

Source

node_modules/.pnpm/@types+node@18.16.16/node_modules/@types/node/globals.d.ts:11

Inherited from

Error.prepareStackTrace


stackTraceLimit

static stackTraceLimit: number

Source

node_modules/.pnpm/@types+node@18.16.16/node_modules/@types/node/globals.d.ts:13

Inherited from

Error.stackTraceLimit

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

Source

node_modules/.pnpm/@types+node@18.16.16/node_modules/@types/node/globals.d.ts:4


Generated using TypeDoc and typedoc-plugin-markdown