Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

514 B
Raw Blame
export type TGoogleApiError = {
  error?: {
    status?: string;
    message?: string;
    errors?: { reason?: string }[];
    details?: { "@type"?: string; reason?: string }[];
  };
};

export const isGcpServiceDisabledError = (body: TGoogleApiError | undefined, message: string) =>
  Boolean(body?.error?.details?.some((detail) => detail.reason === "SERVICE_DISABLED")) ||
  Boolean(body?.error?.errors?.some((err) => err.reason === "accessNotConfigured")) ||
  message.includes("has not been used in project");