AuroraMeter.UndeclaredFeatureError exception (Aurora Meter v1.0.0)

View Source

Raised by the entitlement functions when :undeclared_feature_policy is :raise and the tenant's plan does not declare the feature.

"Undeclared" means not on this tenant's effective plan. A feature some other plan declares is still undeclared here: that is the case the policy exists for, because a :free tenant reaching a :pro only feature used to be answered permissively. reason separates the two, :not_in_plan from :unknown_feature, for logs and telemetry; the outcome is the same.

AuroraMeter.track/4 never raises this: metering is not entitlement.

Summary

Types

Whether the feature is declared on some other plan, or on none at all.

t()

Types

reason()

@type reason() :: :not_in_plan | :unknown_feature

Whether the feature is declared on some other plan, or on none at all.

t()

@type t() :: %AuroraMeter.UndeclaredFeatureError{
  __exception__: term(),
  entry_point: atom(),
  feature: atom(),
  message: term(),
  plan_id: atom() | nil,
  reason: reason(),
  tenant_key: String.t() | nil
}