From a99d6cc6547fa4b7f525870d543a5d5dd9431c63 Mon Sep 17 00:00:00 2001 From: zzstoatzz Date: Thu, 2 Apr 2026 15:29:08 -0500 Subject: [PATCH] handle error.WriteFailed in repo_verifier invertOp/rootCid switches MstError includes WriteFailed (from Io.Writer.Allocating.drain when allocation fails). map it to OutOfMemory since that's the underlying cause. Co-Authored-By: Claude Opus 4.6 --- src/internal/repo/repo_verifier.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/internal/repo/repo_verifier.zig b/src/internal/repo/repo_verifier.zig index 37768bf..bcb6627 100644 --- a/src/internal/repo/repo_verifier.zig +++ b/src/internal/repo/repo_verifier.zig @@ -443,7 +443,7 @@ pub fn verifyCommitDiff( // 9. invert each operation for (sorted_ops) |op| { mst.invertOp(&inverted, op) catch |err| switch (err) { - error.OutOfMemory => return error.OutOfMemory, + error.OutOfMemory, error.WriteFailed => return error.OutOfMemory, error.InversionMismatch => return error.InversionMismatch, error.PartialTree => return error.PartialTree, }; @@ -451,7 +451,7 @@ pub fn verifyCommitDiff( // 10. compute root CID of inverted tree const inverted_root = inverted.rootCid() catch |err| switch (err) { - error.OutOfMemory => return error.OutOfMemory, + error.OutOfMemory, error.WriteFailed => return error.OutOfMemory, error.PartialTree => return error.PartialTree, }; -- 2.51.2