isBillingAbsentError static method

bool isBillingAbsentError(
  1. String stderr
)

Returns true when stderr contains a recognizable "billing is missing or disabled" signature from gcloud / Firebase. Used by initialization code to surface a clear "upgrade to Blaze" hand-off instead of re-rendering the raw HTTP error.

Examples this matches: • HTTPError 403: The billing account for the owning project is disabled in state absentBilling is disabled for project ...BILLING_DISABLEDrequires billing to be enabled

Implementation

static bool isBillingAbsentError(String stderr) {
  final String lower = stderr.toLowerCase();
  return lower.contains('billing account') &&
          (lower.contains('disabled') ||
              lower.contains('absent') ||
              lower.contains('not found')) ||
      lower.contains('billing_disabled') ||
      lower.contains('billing is disabled') ||
      lower.contains('requires billing to be enabled') ||
      lower.contains('requires a billing account');
}