Skip to main content
zerotal

Documentation


Documentation / @zerotal/tenancy / NoActiveTenantError

Class: NoActiveTenantError

Defined in: tenancy/src/errors.ts:61

TenantContext.get() (or Tenant.current()) was called outside an active tenant boundary. A programming error — wrap the code in TenancyMiddleware, or use TenantContext.getOrNull() in shared (tenant + non-tenant) code.

Extends

Constructors

Constructor

new NoActiveTenantError(message?): NoActiveTenantError

Defined in: tenancy/src/errors.ts:62

Parameters

message?

string = "No active tenant. This code ran outside a tenant boundary — is TenancyMiddleware applied? (use TenantContext.getOrNull() in shared code)."

Returns

NoActiveTenantError

Overrides

ZerotalError.constructor

Properties

code

readonly code: string

Defined in: core/src/errors/ZerotalError.ts:18

Inherited from

ZerotalError.code


status

readonly status: number = 500

Defined in: core/src/errors/ZerotalError.ts:19

Inherited from

ZerotalError.status


context?

readonly optional context?: Record<string, unknown>

Defined in: core/src/errors/ZerotalError.ts:20

Inherited from

ZerotalError.context