T3 Stack · Error
TRPCError
TRPCError represents an error raised by a tRPC procedure. The documented pattern uses it with the UNAUTHORIZED code when authentication middleware finds no user.
Last updated
Syntax
new TRPCError({ code: "UNAUTHORIZED" })In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
TRPCprotectedProcedureTRPCErrorUNAUTHORIZEDgetHTTPStatusCodeFromErrorcreateCaller