Type Alias: GuardHandler<R>
ts
type GuardHandler<R> = (opts, context) => MaybePromise<Error>;Defined in: packages/trpc/src/guards.ts:60
Returns the error to throw (or throws it), e.g. a TRPCError with another code. Anything that is not a TRPCError reaches the client as an INTERNAL_SERVER_ERROR.
Type Parameters
| Type Parameter | Default type |
|---|---|
R | SubjectRbac |
Parameters
| Parameter | Type |
|---|---|
opts | GuardHandlerOptions<R> |
context | GuardContext |
Returns
MaybePromise<Error>
