Skip to content
masterclass Buddy

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.

Subscribe
  • TRPC
  • protectedProcedure
  • TRPCError
  • UNAUTHORIZED
  • getHTTPStatusCodeFromError
  • createCaller

Source: tRPC • Create T3 App. Checked 2026-11-03.