TRPCError
Hierarchy
Error.TRPCError
Constructors
constructor()
Signature
tsnew TRPCError(opts: object): TRPCError;
tsnew TRPCError(opts: object): TRPCError;
Parameters
| Name | Type |
|---|---|
opts | object |
opts.cause? | unknown |
opts.code | "PARSE_ERROR" | "BAD_REQUEST" | "INTERNAL_SERVER_ERROR" | "UNAUTHORIZED" | "FORBIDDEN" | "NOT_FOUND" | "METHOD_NOT_SUPPORTED" | "TIMEOUT" | "CONFLICT" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "TOO_MANY_REQUESTS" | "CLIENT_CLOSED_REQUEST" |
opts.message? | string |
Returns
Overrides: Error.constructor
Defined in: packages/server/src/error/TRPCError.ts:30
Properties
cause?
Error
Defined in: packages/server/src/error/TRPCError.ts:27
code
Readonly"PARSE_ERROR"|"BAD_REQUEST"|"INTERNAL_SERVER_ERROR"|"UNAUTHORIZED"|"FORBIDDEN"|"NOT_FOUND"|"METHOD_NOT_SUPPORTED"|"TIMEOUT"|"CONFLICT"|"PRECONDITION_FAILED"|"PAYLOAD_TOO_LARGE"|"TOO_MANY_REQUESTS"|"CLIENT_CLOSED_REQUEST"
Defined in: packages/server/src/error/TRPCError.ts:28
message
string
Inherited from: Error.message
Defined in: node_modules/.pnpm/typescript@4.8.3/node_modules/typescript/lib/lib.es5.d.ts:1041
name
string
Inherited from: Error.name
Defined in: node_modules/.pnpm/typescript@4.8.3/node_modules/typescript/lib/lib.es5.d.ts:1040
stack?
string
Inherited from: Error.stack
Defined in: node_modules/.pnpm/typescript@4.8.3/node_modules/typescript/lib/lib.es5.d.ts:1042
prepareStackTrace?
Function
Type declaration
Optional override for formatting stack traces
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Signature
ts(err: Error, stackTraces: CallSite[]): any;
ts(err: Error, stackTraces: CallSite[]): any;
Parameters
| Name | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
Inherited from: Error.prepareStackTrace
Defined in: node_modules/.pnpm/@types+node@18.7.20/node_modules/@types/node/ts4.8/globals.d.ts:11
stackTraceLimit
Staticnumber
Inherited from: Error.stackTraceLimit
Defined in: node_modules/.pnpm/@types+node@18.7.20/node_modules/@types/node/ts4.8/globals.d.ts:13
Methods
captureStackTrace()
Create .stack property on a target object
Signature
tsStatic captureStackTrace(targetObject: object, constructorOpt?: Function): void;
tsStatic captureStackTrace(targetObject: object, constructorOpt?: Function): void;
Parameters
| Name | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from: Error.captureStackTrace
Defined in: node_modules/.pnpm/@types+node@18.7.20/node_modules/@types/node/ts4.8/globals.d.ts:4