Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
873 B · 28 lines
TypeScript
1234567891011121314151617181920212223242526272829export const deploymentCodes = [ "recovery_required", "artifact_unavailable", "setup_required", "reauthorization_required", "account_denied", "resource_conflict", "deployment_failed", "health_failed", "temporarily_unavailable",] as const;export type DeploymentCode = (typeof deploymentCodes)[number];export class DeploymentError extends Error { readonly code: DeploymentCode; constructor(code: DeploymentCode) { super(code); this.code = code; }}export function deploymentCode(error: unknown): DeploymentCode { if (error instanceof DeploymentError) return error.code; // Never pass provider bodies, network URLs, credentials or arbitrary messages // into Workflow error history or installation metadata. return "temporarily_unavailable";}export function fail(code: DeploymentCode): never { throw new DeploymentError(code);}