import { InfrastructureError } from "./infrastructure-errors";

export class InfrastructureUnavailableError extends InfrastructureError {
  public readonly code = "UNAVAILABLE" as const;
  constructor(message = "Underlying service temporarily unavailable", options?: ErrorOptions) {
    super(message, options);
  }
}

export const isInfrastructureUnavailableError = (e: unknown): e is InfrastructureUnavailableError =>
  e instanceof InfrastructureUnavailableError;
