throw new TRPCError({ code: "NOT_FOUND" }); where 'code' is a string union type with some pre-defined options. This is important because any error that is thrown in a tRPC procedure that is not a TRPCError (or extends it) is treated as a InternalServerError (if I would use Effect.die for example). That breaks my existing tRPC error formatter function so I try to get around that (in my example redirecting the user to a 404 page in the react app).TRPCError({ code: "NOT_FOUND" }) . In all other cases for now I am happy with just logging the error with console.err() and throwing a TRPCError({ code: "INTERNAL_SERVER_ERROR" })