Skip to content
tRPC

Partners

Function: getTRPCErrorFromUnknown()

On this page

getTRPCErrorFromUnknown(cause): TRPCError

Defined in: packages/server/src/unstable-core-do-not-import/error/TRPCError.ts:64

Turns anything thrown into a TRPCError. A TRPCError is returned as is; anything else becomes an INTERNAL_SERVER_ERROR with it as the cause.

Parameters

ParameterType
causeunknown

Returns

TRPCError