export type CreditErrorCode =
  | "credit_account_not_found"
  | "credit_generation_not_found"
  | "credit_insufficient"
  | "credit_invariant_failed"
  | "credit_operation_conflict"
  | "credit_request_invalid";

export class CreditError extends Error {
  readonly code: CreditErrorCode;

  constructor(code: CreditErrorCode) {
    super(code);
    this.code = code;
  }
}
