diff --git a/mina-staking-ledgers-exporter/scripts/mina-staking-ledgers-exporter.py b/mina-staking-ledgers-exporter/scripts/mina-staking-ledgers-exporter.py index 7e237327..26db136d 100755 --- a/mina-staking-ledgers-exporter/scripts/mina-staking-ledgers-exporter.py +++ b/mina-staking-ledgers-exporter/scripts/mina-staking-ledgers-exporter.py @@ -42,8 +42,11 @@ def main(): logger.info(f" -- Processing next epoch ({next_epoch}) --") try: process_staking_ledger(synced_pod, next_epoch, "next-epoch-ledger") - except Exception as e: - logger.warning(f"Unable to process the next epoch {next_epoch} due to error: {e}, skipping further processing.") + except subprocess.CalledProcessError as e: + if "Ledger not found: next staking ledger is not finalized yet" in e.output: + logger.warning(f"Unable to process the next epoch {next_epoch} due to error: {e.output}, skipping further processing.") + else: + raise e logger.info("Complete with success")