Factory that creates a middleware function resolving the tenant and attaching
it to ctx.request.tenant.
On successful resolution: calls next().
When required: true and no tenant resolves: short-circuits with a 400
(or rejectionStatus) without calling next(), written through the error
responder seam (respondWithError in @setu-ts/common) so it answers in the
application's configured format when errorHandler is registered, and in the
no-handler fallback shape { error, detail? } otherwise.
When required: false and no tenant resolves: proceeds with
ctx.request.tenant === undefined.
A throwing resolver is caught, warned (when logger is present), treated as
none(), and the chain continues to the next resolver.
Factory that creates a middleware function resolving the tenant and attaching it to
ctx.request.tenant.On successful resolution: calls
next(). Whenrequired: trueand no tenant resolves: short-circuits with a 400 (orrejectionStatus) without callingnext(), written through the error responder seam (respondWithErrorin@setu-ts/common) so it answers in the application's configured format whenerrorHandleris registered, and in the no-handler fallback shape{ error, detail? }otherwise. Whenrequired: falseand no tenant resolves: proceeds withctx.request.tenant === undefined.A throwing resolver is caught, warned (when logger is present), treated as
none(), and the chain continues to the next resolver.